This R Markdown Notebook
reproduces the analysis of TE001 at the gene expression level. The first
section of the Tutorial makes use of the default parameters of the
Seurat pipeline. The second part of the tutorial finds a
close-to-optimal clustering solution obtained with the Louvain
algorithm, by returning the solution with the highest silhouette by
optimizing over two parameters, the number of nearest neighbors
(NN) and the resolution (res).
Clean the environment.
rm(list = ls())
Set paths to the folders containing data, metadata, output figures and saving directory (to save)
DataFolder <- "/Volumes/ac_lab_scratch/lz2841/ics-rebuttal/TE001/filtered_feature_bc_matrix/"
metadata_path <- "/Volumes/ac_lab_scratch/lz2841/ics-rebuttal/TE001-h5ad/"
savingsFolder <- DataFolder
figures_path = "/Volumes/ac_lab_scratch/lz2841/ics-rebuttal/figures/TE001_gExpr_clustering/"
Decide whether to optimize the clustering solution (later on, in this markdown document) or whether to use previously optimized clustering parameters.
running_clustering <- FALSE # do not re-run clustering
cat("'runnig_clustering' is set to: ", running_clustering,"\n")
'runnig_clustering' is set to: FALSE
Define previously determined clustering parameters (not used if
running_clustering is set to FALSE). These
parameters were obtained with a iterative subclustering routine, as the
one shown in the following sections using the acdc package
available at: https://github.com/califano-lab/acdc. While the
reproducibility of the obtain solution was tested, future updates of the
package or different laptop configuration might result in different
solutions. If this is the case, we recommend: (1) loading the Seurat
object generated with this tutorial or (2) re-running the clustering
optimization from the scratch, by setting
running_clustering = TRUE. For enhanced performance,
acdc comes also with a Grid Search-based optimization that
allows for multi-thread, thus speeding up the computation.
# optimal clustering parameters - previously determined
# step 1
opt_param <- c(0.03013859, 22) # res NN
# step 2 (subclustering)
optim_par_list <- matrix(c(0.05655232, 7, 0.0876204, 8, 0.06659604, 7),byrow=TRUE,nrow=3,ncol=2)
colnames(optim_par_list) <- c("res", "NN")
rownames(optim_par_list) <- c("1", "3", "2")
Load libraries.
library(dplyr)
library(matrixStats)
library(Seurat)
library(tibble)
library(acdc)
library(cluster)
library(ggplot2)
library(factoextra)
library(ComplexHeatmap)
library(RColorBrewer)
library(circlize)
library(gridExtra)
Define thresholds for cell filtering.
min_cells <- 5
min_feats <- 1000
min_nFeature_RNA <- 1500
max_nFeature_RNA <- 20000
max_nCount_RNA <- 100000
mt_percent_threshold <- 10
Load UMI counts and create Seurat Object.
# counts
TE001_data <- Read10X(file.path(data.dir=file.path(DataFolder))) # load counts
# generate Seurat object
TE001 <- CreateSeuratObject(counts=TE001_data,
project="TE001",
assay="RNA",
min.cells = min_cells,
min.features = min_feats)
TE001@meta.data$cell_id <- rownames(TE001@meta.data)
TE001@meta.data <- TE001@meta.data %>% dplyr::select(.,cell_id, everything())
Visualize QC as violin plots before filtering.
TE001[["percent.mt"]] <- PercentageFeatureSet(TE001, pattern="^mt")
VlnPlot(TE001, features = c("nFeature_RNA", "nCount_RNA", "percent.mt"), ncol = 3, pt.size=0)
Filter out low quality cells and visualize QC plots after filtering.
# Filter out cells
TE001 <- subset(TE001, subset = nFeature_RNA > min_nFeature_RNA & nFeature_RNA < max_nFeature_RNA & nCount_RNA < max_nCount_RNA & percent.mt < mt_percent_threshold)
# Visualize QC metrics as a violin plot AFTER filtering
VlnPlot(TE001, features = c("nFeature_RNA", "nCount_RNA", "percent.mt"), ncol = 3, pt.size=0)
# FeatureScatter is typically used to visualize feature-feature relationships
plot1 <- FeatureScatter(TE001, feature1 = "nCount_RNA", feature2 = "percent.mt", col="darkgray")
plot2 <- FeatureScatter(TE001, feature1 = "nCount_RNA", feature2 = "nFeature_RNA", col="darkgray")
grid.arrange(plot1, plot2, ncol = 2)
Load additional metadata and include in Seurat object.
# load additional metadata for the cells
metadata_csv <- file.path(metadata_path, "TE001-metadata-umap-and-clusters-for-paper.csv")
metadata <- read.csv(metadata_csv)
# join metadata to Seurat object
TE001@meta.data <- TE001@meta.data %>% dplyr::left_join(., metadata,
by = c("cell_id" = "cell_id"))
rownames(TE001@meta.data) <- TE001@meta.data$cell_id
Log-Normalize data, find and display highly variable genes and scale data.
# Normalize Data
TE001 <- NormalizeData(TE001, normalization.method = "LogNormalize", scale.factor = 10000)
Performing log-normalization
0% 10 20 30 40 50 60 70 80 90 100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
# Finding Variable features
TE001 <- FindVariableFeatures(TE001, selection.method = "vst", nfeatures = 2000)
Calculating gene variances
0% 10 20 30 40 50 60 70 80 90 100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0% 10 20 30 40 50 60 70 80 90 100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
top10_hvg <- head(VariableFeatures(TE001), 10)
plot1 <- VariableFeaturePlot(TE001)
plot2 <- LabelPoints(plot = plot1, points = top10_hvg, repel = TRUE, xnudge=0, ynudge=0)
plot2
dev.off()
null device
1
# Scaling the data
all.genes <- rownames(TE001)
TE001 <- ScaleData(TE001, features = all.genes)
Centering and scaling data matrix
|
| | 0%
|
|========= | 6%
|
|================== | 12%
|
|=========================== | 19%
|
|==================================== | 25%
|
|============================================ | 31%
|
|===================================================== | 38%
|
|============================================================== | 44%
|
|======================================================================= | 50%
|
|================================================================================ | 56%
|
|========================================================================================= | 62%
|
|================================================================================================== | 69%
|
|========================================================================================================== | 75%
|
|=================================================================================================================== | 81%
|
|============================================================================================================================ | 88%
|
|===================================================================================================================================== | 94%
|
|==============================================================================================================================================| 100%
Cluster cells with Louvain algorithm. 0.5 is used as the resolution value, as in https://satijalab.org/seurat/articles/pbmc3k_tutorial.
# Perform linear dimensionality reduction
TE001 <- RunPCA(TE001, verbose=F)
# Cluster the cells with default parameters
TE001 <- FindNeighbors(TE001, k.param = 20)
Computing nearest neighbor graph
Computing SNN
TE001 <- FindClusters(TE001, resolution = 0.5) #
Modularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck
Number of nodes: 3656
Number of edges: 103035
Running Louvain algorithm...
0% 10 20 30 40 50 60 70 80 90 100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Maximum modularity in 10 random starts: 0.8939
Number of communities: 12
Elapsed time: 0 seconds
levels(TE001@meta.data$seurat_clusters) <- as.character(as.numeric(levels(TE001@meta.data$seurat_clusters)) + 1)
Evaluate the quality of clustering solution by visualizing the Silhouette Score.
# evaluate clustering solution
PCs<-as.data.frame(TE001$pca@cell.embeddings[,1:10])
euc_distance<-dist(PCs, method="euclidean")
s <- silhouette( as.integer(TE001$seurat_clusters) , euc_distance )
pdf(file.path(figures_path, "silhouette_default.pdf") , width = 6 , height = 8)
fviz_silhouette(s,print.summary = FALSE)
dev.off()
null device
1
fviz_silhouette(s,print.summary = FALSE)
Visualize clusters at gene expression on a UMAP embedding.
TE001 <- RunUMAP(TE001, dims = 1:10)
10:15:43 UMAP embedding parameters a = 0.9922 b = 1.112
10:15:43 Read 3656 rows and found 10 numeric columns
10:15:43 Using Annoy for neighbor search, n_neighbors = 30
10:15:43 Building Annoy index with metric = cosine, n_trees = 50
0% 10 20 30 40 50 60 70 80 90 100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
10:15:43 Writing NN index file to temp file /var/folders/_d/34rjbm053_n2jgnf4njw2l7h0000gn/T//Rtmp99Ud1h/file1b56732c8ea8
10:15:43 Searching Annoy index using 1 thread, search_k = 3000
10:15:44 Annoy recall = 100%
10:15:44 Commencing smooth kNN distance calibration using 1 thread with target n_neighbors = 30
10:15:45 Initializing from normalized Laplacian + noise (using irlba)
10:15:45 Commencing optimization for 500 epochs, with 135708 positive edges
Using method 'umap'
0% 10 20 30 40 50 60 70 80 90 100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
10:15:48 Optimization finished
pdf(file.path(figures_path, "umap_clusters_default.pdf") ,width = 12, height = 6)
DimPlot(TE001, reduction = "umap", pt.size=1.5, group.by = c("seurat_clusters","iter_cluster_id_with_paneth"))
dev.off()
null device
1
pdf(file.path(figures_path, "umap_default_cytotrace.pdf") , width = 6 , height = 6)
FeaturePlot(TE001, features = "cytotrace_te001", pt.size=1.5) & scale_color_viridis_c()
Scale for colour is already present.
Adding another scale for colour, which will replace the existing scale.
dev.off()
null device
1
# Show figures in cell
DimPlot(TE001, reduction = "umap", pt.size=1.5, group.by = "seurat_clusters")
DimPlot(TE001, reduction = "umap", pt.size=1.5, group.by = "iter_cluster_id_with_paneth")
FeaturePlot(TE001, features = "cytotrace_te001", pt.size=1.5) & scale_color_viridis_c()
Scale for colour is already present.
Adding another scale for colour, which will replace the existing scale.
Perform differential gene expression analysis on the identified clusters with default Seurat pipeline
Idents(TE001) <- "seurat_clusters"
# FindAllMarkers with default parameters
TE001_markers <- FindAllMarkers(TE001,
assay = "RNA",
slot="data",
test.use = "wilcox",
only.pos = TRUE)
Calculating cluster 1
| | 0 % ~calculating
|+ | 1 % ~02s
|++ | 2 % ~02s
|++ | 3 % ~02s
|+++ | 4 % ~02s
|+++ | 5 % ~02s
|++++ | 6 % ~02s
|++++ | 7 % ~02s
|+++++ | 8 % ~02s
|+++++ | 9 % ~02s
|++++++ | 10% ~02s
|++++++ | 11% ~01s
|+++++++ | 12% ~01s
|+++++++ | 13% ~01s
|++++++++ | 14% ~01s
|++++++++ | 15% ~01s
|+++++++++ | 16% ~01s
|+++++++++ | 17% ~01s
|++++++++++ | 18% ~01s
|++++++++++ | 19% ~01s
|+++++++++++ | 20% ~01s
|+++++++++++ | 21% ~01s
|++++++++++++ | 22% ~01s
|++++++++++++ | 23% ~01s
|+++++++++++++ | 24% ~01s
|+++++++++++++ | 25% ~01s
|++++++++++++++ | 26% ~01s
|++++++++++++++ | 27% ~01s
|+++++++++++++++ | 28% ~01s
|+++++++++++++++ | 29% ~01s
|++++++++++++++++ | 30% ~01s
|++++++++++++++++ | 31% ~01s
|+++++++++++++++++ | 32% ~01s
|+++++++++++++++++ | 33% ~01s
|++++++++++++++++++ | 34% ~01s
|++++++++++++++++++ | 35% ~01s
|+++++++++++++++++++ | 36% ~01s
|+++++++++++++++++++ | 37% ~01s
|++++++++++++++++++++ | 38% ~01s
|++++++++++++++++++++ | 39% ~01s
|+++++++++++++++++++++ | 40% ~01s
|+++++++++++++++++++++ | 41% ~01s
|++++++++++++++++++++++ | 42% ~01s
|++++++++++++++++++++++ | 43% ~01s
|+++++++++++++++++++++++ | 44% ~01s
|+++++++++++++++++++++++ | 45% ~01s
|++++++++++++++++++++++++ | 46% ~01s
|++++++++++++++++++++++++ | 47% ~01s
|+++++++++++++++++++++++++ | 48% ~01s
|+++++++++++++++++++++++++ | 49% ~01s
|++++++++++++++++++++++++++ | 51% ~01s
|++++++++++++++++++++++++++ | 52% ~01s
|+++++++++++++++++++++++++++ | 53% ~01s
|+++++++++++++++++++++++++++ | 54% ~01s
|++++++++++++++++++++++++++++ | 55% ~01s
|++++++++++++++++++++++++++++ | 56% ~01s
|+++++++++++++++++++++++++++++ | 57% ~01s
|+++++++++++++++++++++++++++++ | 58% ~01s
|++++++++++++++++++++++++++++++ | 59% ~01s
|++++++++++++++++++++++++++++++ | 60% ~01s
|+++++++++++++++++++++++++++++++ | 61% ~01s
|+++++++++++++++++++++++++++++++ | 62% ~01s
|++++++++++++++++++++++++++++++++ | 63% ~01s
|++++++++++++++++++++++++++++++++ | 64% ~01s
|+++++++++++++++++++++++++++++++++ | 65% ~01s
|+++++++++++++++++++++++++++++++++ | 66% ~01s
|++++++++++++++++++++++++++++++++++ | 67% ~01s
|++++++++++++++++++++++++++++++++++ | 68% ~01s
|+++++++++++++++++++++++++++++++++++ | 69% ~01s
|+++++++++++++++++++++++++++++++++++ | 70% ~01s
|++++++++++++++++++++++++++++++++++++ | 71% ~00s
|++++++++++++++++++++++++++++++++++++ | 72% ~00s
|+++++++++++++++++++++++++++++++++++++ | 73% ~00s
|+++++++++++++++++++++++++++++++++++++ | 74% ~00s
|++++++++++++++++++++++++++++++++++++++ | 75% ~00s
|++++++++++++++++++++++++++++++++++++++ | 76% ~00s
|+++++++++++++++++++++++++++++++++++++++ | 77% ~00s
|+++++++++++++++++++++++++++++++++++++++ | 78% ~00s
|++++++++++++++++++++++++++++++++++++++++ | 79% ~00s
|++++++++++++++++++++++++++++++++++++++++ | 80% ~00s
|+++++++++++++++++++++++++++++++++++++++++ | 81% ~00s
|+++++++++++++++++++++++++++++++++++++++++ | 82% ~00s
|++++++++++++++++++++++++++++++++++++++++++ | 83% ~00s
|++++++++++++++++++++++++++++++++++++++++++ | 84% ~00s
|+++++++++++++++++++++++++++++++++++++++++++ | 85% ~00s
|+++++++++++++++++++++++++++++++++++++++++++ | 86% ~00s
|++++++++++++++++++++++++++++++++++++++++++++ | 87% ~00s
|++++++++++++++++++++++++++++++++++++++++++++ | 88% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++ | 89% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++ | 90% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++ | 91% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++ | 92% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 93% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 94% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 95% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 96% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=02s
Calculating cluster 2
| | 0 % ~calculating
|+ | 1 % ~01s
|++ | 2 % ~01s
|++ | 3 % ~01s
|+++ | 5 % ~01s
|+++ | 6 % ~01s
|++++ | 7 % ~01s
|+++++ | 8 % ~01s
|+++++ | 9 % ~01s
|++++++ | 10% ~01s
|++++++ | 12% ~01s
|+++++++ | 13% ~01s
|+++++++ | 14% ~01s
|++++++++ | 15% ~01s
|+++++++++ | 16% ~01s
|+++++++++ | 17% ~01s
|++++++++++ | 19% ~01s
|++++++++++ | 20% ~01s
|+++++++++++ | 21% ~01s
|++++++++++++ | 22% ~01s
|++++++++++++ | 23% ~01s
|+++++++++++++ | 24% ~01s
|+++++++++++++ | 26% ~01s
|++++++++++++++ | 27% ~01s
|++++++++++++++ | 28% ~01s
|+++++++++++++++ | 29% ~01s
|++++++++++++++++ | 30% ~01s
|++++++++++++++++ | 31% ~01s
|+++++++++++++++++ | 33% ~01s
|+++++++++++++++++ | 34% ~01s
|++++++++++++++++++ | 35% ~01s
|+++++++++++++++++++ | 36% ~01s
|+++++++++++++++++++ | 37% ~01s
|++++++++++++++++++++ | 38% ~01s
|++++++++++++++++++++ | 40% ~01s
|+++++++++++++++++++++ | 41% ~01s
|+++++++++++++++++++++ | 42% ~01s
|++++++++++++++++++++++ | 43% ~01s
|+++++++++++++++++++++++ | 44% ~01s
|+++++++++++++++++++++++ | 45% ~01s
|++++++++++++++++++++++++ | 47% ~01s
|++++++++++++++++++++++++ | 48% ~01s
|+++++++++++++++++++++++++ | 49% ~01s
|+++++++++++++++++++++++++ | 50% ~01s
|++++++++++++++++++++++++++ | 51% ~01s
|+++++++++++++++++++++++++++ | 52% ~01s
|+++++++++++++++++++++++++++ | 53% ~01s
|++++++++++++++++++++++++++++ | 55% ~00s
|++++++++++++++++++++++++++++ | 56% ~00s
|+++++++++++++++++++++++++++++ | 57% ~00s
|++++++++++++++++++++++++++++++ | 58% ~00s
|++++++++++++++++++++++++++++++ | 59% ~00s
|+++++++++++++++++++++++++++++++ | 60% ~00s
|+++++++++++++++++++++++++++++++ | 62% ~00s
|++++++++++++++++++++++++++++++++ | 63% ~00s
|++++++++++++++++++++++++++++++++ | 64% ~00s
|+++++++++++++++++++++++++++++++++ | 65% ~00s
|++++++++++++++++++++++++++++++++++ | 66% ~00s
|++++++++++++++++++++++++++++++++++ | 67% ~00s
|+++++++++++++++++++++++++++++++++++ | 69% ~00s
|+++++++++++++++++++++++++++++++++++ | 70% ~00s
|++++++++++++++++++++++++++++++++++++ | 71% ~00s
|+++++++++++++++++++++++++++++++++++++ | 72% ~00s
|+++++++++++++++++++++++++++++++++++++ | 73% ~00s
|++++++++++++++++++++++++++++++++++++++ | 74% ~00s
|++++++++++++++++++++++++++++++++++++++ | 76% ~00s
|+++++++++++++++++++++++++++++++++++++++ | 77% ~00s
|+++++++++++++++++++++++++++++++++++++++ | 78% ~00s
|++++++++++++++++++++++++++++++++++++++++ | 79% ~00s
|+++++++++++++++++++++++++++++++++++++++++ | 80% ~00s
|+++++++++++++++++++++++++++++++++++++++++ | 81% ~00s
|++++++++++++++++++++++++++++++++++++++++++ | 83% ~00s
|++++++++++++++++++++++++++++++++++++++++++ | 84% ~00s
|+++++++++++++++++++++++++++++++++++++++++++ | 85% ~00s
|++++++++++++++++++++++++++++++++++++++++++++ | 86% ~00s
|++++++++++++++++++++++++++++++++++++++++++++ | 87% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++ | 88% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++ | 90% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++ | 91% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++ | 92% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 93% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 94% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 95% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=01s
Calculating cluster 3
| | 0 % ~calculating
|+ | 1 % ~01s
|++ | 3 % ~01s
|++ | 4 % ~01s
|+++ | 5 % ~01s
|++++ | 6 % ~01s
|++++ | 8 % ~01s
|+++++ | 9 % ~01s
|++++++ | 10% ~01s
|++++++ | 12% ~01s
|+++++++ | 13% ~01s
|++++++++ | 14% ~01s
|++++++++ | 16% ~01s
|+++++++++ | 17% ~01s
|++++++++++ | 18% ~01s
|++++++++++ | 19% ~01s
|+++++++++++ | 21% ~01s
|++++++++++++ | 22% ~01s
|++++++++++++ | 23% ~01s
|+++++++++++++ | 25% ~01s
|+++++++++++++ | 26% ~01s
|++++++++++++++ | 27% ~01s
|+++++++++++++++ | 29% ~01s
|+++++++++++++++ | 30% ~01s
|++++++++++++++++ | 31% ~01s
|+++++++++++++++++ | 32% ~01s
|+++++++++++++++++ | 34% ~01s
|++++++++++++++++++ | 35% ~01s
|+++++++++++++++++++ | 36% ~01s
|+++++++++++++++++++ | 38% ~01s
|++++++++++++++++++++ | 39% ~01s
|+++++++++++++++++++++ | 40% ~01s
|+++++++++++++++++++++ | 42% ~01s
|++++++++++++++++++++++ | 43% ~01s
|+++++++++++++++++++++++ | 44% ~01s
|+++++++++++++++++++++++ | 45% ~01s
|++++++++++++++++++++++++ | 47% ~01s
|+++++++++++++++++++++++++ | 48% ~01s
|+++++++++++++++++++++++++ | 49% ~01s
|++++++++++++++++++++++++++ | 51% ~01s
|++++++++++++++++++++++++++ | 52% ~01s
|+++++++++++++++++++++++++++ | 53% ~01s
|++++++++++++++++++++++++++++ | 55% ~01s
|++++++++++++++++++++++++++++ | 56% ~01s
|+++++++++++++++++++++++++++++ | 57% ~01s
|++++++++++++++++++++++++++++++ | 58% ~01s
|++++++++++++++++++++++++++++++ | 60% ~00s
|+++++++++++++++++++++++++++++++ | 61% ~00s
|++++++++++++++++++++++++++++++++ | 62% ~00s
|++++++++++++++++++++++++++++++++ | 64% ~00s
|+++++++++++++++++++++++++++++++++ | 65% ~00s
|++++++++++++++++++++++++++++++++++ | 66% ~00s
|++++++++++++++++++++++++++++++++++ | 68% ~00s
|+++++++++++++++++++++++++++++++++++ | 69% ~00s
|++++++++++++++++++++++++++++++++++++ | 70% ~00s
|++++++++++++++++++++++++++++++++++++ | 71% ~00s
|+++++++++++++++++++++++++++++++++++++ | 73% ~00s
|++++++++++++++++++++++++++++++++++++++ | 74% ~00s
|++++++++++++++++++++++++++++++++++++++ | 75% ~00s
|+++++++++++++++++++++++++++++++++++++++ | 77% ~00s
|+++++++++++++++++++++++++++++++++++++++ | 78% ~00s
|++++++++++++++++++++++++++++++++++++++++ | 79% ~00s
|+++++++++++++++++++++++++++++++++++++++++ | 81% ~00s
|+++++++++++++++++++++++++++++++++++++++++ | 82% ~00s
|++++++++++++++++++++++++++++++++++++++++++ | 83% ~00s
|+++++++++++++++++++++++++++++++++++++++++++ | 84% ~00s
|+++++++++++++++++++++++++++++++++++++++++++ | 86% ~00s
|++++++++++++++++++++++++++++++++++++++++++++ | 87% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++ | 88% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++ | 90% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++ | 91% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 92% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 94% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 95% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 96% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=01s
Calculating cluster 4
| | 0 % ~calculating
|+ | 1 % ~01s
|++ | 3 % ~01s
|+++ | 4 % ~01s
|+++ | 6 % ~01s
|++++ | 7 % ~01s
|+++++ | 9 % ~01s
|++++++ | 10% ~01s
|++++++ | 12% ~01s
|+++++++ | 13% ~01s
|++++++++ | 15% ~01s
|+++++++++ | 16% ~01s
|+++++++++ | 18% ~01s
|++++++++++ | 19% ~01s
|+++++++++++ | 21% ~01s
|++++++++++++ | 22% ~01s
|++++++++++++ | 24% ~01s
|+++++++++++++ | 25% ~01s
|++++++++++++++ | 27% ~01s
|+++++++++++++++ | 28% ~01s
|+++++++++++++++ | 30% ~01s
|++++++++++++++++ | 31% ~01s
|+++++++++++++++++ | 33% ~01s
|++++++++++++++++++ | 34% ~01s
|++++++++++++++++++ | 36% ~01s
|+++++++++++++++++++ | 37% ~00s
|++++++++++++++++++++ | 39% ~00s
|+++++++++++++++++++++ | 40% ~00s
|+++++++++++++++++++++ | 42% ~00s
|++++++++++++++++++++++ | 43% ~00s
|+++++++++++++++++++++++ | 45% ~00s
|++++++++++++++++++++++++ | 46% ~00s
|++++++++++++++++++++++++ | 48% ~00s
|+++++++++++++++++++++++++ | 49% ~00s
|++++++++++++++++++++++++++ | 51% ~00s
|+++++++++++++++++++++++++++ | 52% ~00s
|+++++++++++++++++++++++++++ | 54% ~00s
|++++++++++++++++++++++++++++ | 55% ~00s
|+++++++++++++++++++++++++++++ | 57% ~00s
|++++++++++++++++++++++++++++++ | 58% ~00s
|++++++++++++++++++++++++++++++ | 60% ~00s
|+++++++++++++++++++++++++++++++ | 61% ~00s
|++++++++++++++++++++++++++++++++ | 63% ~00s
|+++++++++++++++++++++++++++++++++ | 64% ~00s
|+++++++++++++++++++++++++++++++++ | 66% ~00s
|++++++++++++++++++++++++++++++++++ | 67% ~00s
|+++++++++++++++++++++++++++++++++++ | 69% ~00s
|++++++++++++++++++++++++++++++++++++ | 70% ~00s
|++++++++++++++++++++++++++++++++++++ | 72% ~00s
|+++++++++++++++++++++++++++++++++++++ | 73% ~00s
|++++++++++++++++++++++++++++++++++++++ | 75% ~00s
|+++++++++++++++++++++++++++++++++++++++ | 76% ~00s
|+++++++++++++++++++++++++++++++++++++++ | 78% ~00s
|++++++++++++++++++++++++++++++++++++++++ | 79% ~00s
|+++++++++++++++++++++++++++++++++++++++++ | 81% ~00s
|++++++++++++++++++++++++++++++++++++++++++ | 82% ~00s
|++++++++++++++++++++++++++++++++++++++++++ | 84% ~00s
|+++++++++++++++++++++++++++++++++++++++++++ | 85% ~00s
|++++++++++++++++++++++++++++++++++++++++++++ | 87% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++ | 88% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++ | 90% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++ | 91% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 93% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 94% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 96% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=01s
Calculating cluster 5
| | 0 % ~calculating
|+ | 1 % ~03s
|++ | 2 % ~03s
|++ | 3 % ~03s
|+++ | 4 % ~03s
|+++ | 5 % ~03s
|++++ | 6 % ~03s
|++++ | 7 % ~03s
|+++++ | 8 % ~03s
|+++++ | 9 % ~03s
|++++++ | 10% ~03s
|++++++ | 11% ~03s
|+++++++ | 12% ~03s
|+++++++ | 13% ~03s
|++++++++ | 14% ~03s
|++++++++ | 15% ~03s
|+++++++++ | 16% ~03s
|+++++++++ | 17% ~03s
|++++++++++ | 18% ~03s
|++++++++++ | 19% ~03s
|+++++++++++ | 20% ~03s
|+++++++++++ | 21% ~03s
|++++++++++++ | 22% ~03s
|++++++++++++ | 23% ~03s
|+++++++++++++ | 24% ~02s
|+++++++++++++ | 26% ~02s
|++++++++++++++ | 27% ~02s
|++++++++++++++ | 28% ~02s
|+++++++++++++++ | 29% ~02s
|+++++++++++++++ | 30% ~02s
|++++++++++++++++ | 31% ~02s
|++++++++++++++++ | 32% ~02s
|+++++++++++++++++ | 33% ~02s
|+++++++++++++++++ | 34% ~02s
|++++++++++++++++++ | 35% ~02s
|++++++++++++++++++ | 36% ~02s
|+++++++++++++++++++ | 37% ~02s
|+++++++++++++++++++ | 38% ~02s
|++++++++++++++++++++ | 39% ~02s
|++++++++++++++++++++ | 40% ~02s
|+++++++++++++++++++++ | 41% ~02s
|+++++++++++++++++++++ | 42% ~02s
|++++++++++++++++++++++ | 43% ~02s
|++++++++++++++++++++++ | 44% ~02s
|+++++++++++++++++++++++ | 45% ~02s
|+++++++++++++++++++++++ | 46% ~02s
|++++++++++++++++++++++++ | 47% ~02s
|++++++++++++++++++++++++ | 48% ~02s
|+++++++++++++++++++++++++ | 49% ~02s
|+++++++++++++++++++++++++ | 50% ~02s
|++++++++++++++++++++++++++ | 51% ~02s
|+++++++++++++++++++++++++++ | 52% ~02s
|+++++++++++++++++++++++++++ | 53% ~02s
|++++++++++++++++++++++++++++ | 54% ~02s
|++++++++++++++++++++++++++++ | 55% ~01s
|+++++++++++++++++++++++++++++ | 56% ~01s
|+++++++++++++++++++++++++++++ | 57% ~01s
|++++++++++++++++++++++++++++++ | 58% ~01s
|++++++++++++++++++++++++++++++ | 59% ~01s
|+++++++++++++++++++++++++++++++ | 60% ~01s
|+++++++++++++++++++++++++++++++ | 61% ~01s
|++++++++++++++++++++++++++++++++ | 62% ~01s
|++++++++++++++++++++++++++++++++ | 63% ~01s
|+++++++++++++++++++++++++++++++++ | 64% ~01s
|+++++++++++++++++++++++++++++++++ | 65% ~01s
|++++++++++++++++++++++++++++++++++ | 66% ~01s
|++++++++++++++++++++++++++++++++++ | 67% ~01s
|+++++++++++++++++++++++++++++++++++ | 68% ~01s
|+++++++++++++++++++++++++++++++++++ | 69% ~01s
|++++++++++++++++++++++++++++++++++++ | 70% ~01s
|++++++++++++++++++++++++++++++++++++ | 71% ~01s
|+++++++++++++++++++++++++++++++++++++ | 72% ~01s
|+++++++++++++++++++++++++++++++++++++ | 73% ~01s
|++++++++++++++++++++++++++++++++++++++ | 74% ~01s
|++++++++++++++++++++++++++++++++++++++ | 76% ~01s
|+++++++++++++++++++++++++++++++++++++++ | 77% ~01s
|+++++++++++++++++++++++++++++++++++++++ | 78% ~01s
|++++++++++++++++++++++++++++++++++++++++ | 79% ~01s
|++++++++++++++++++++++++++++++++++++++++ | 80% ~01s
|+++++++++++++++++++++++++++++++++++++++++ | 81% ~01s
|+++++++++++++++++++++++++++++++++++++++++ | 82% ~01s
|++++++++++++++++++++++++++++++++++++++++++ | 83% ~01s
|++++++++++++++++++++++++++++++++++++++++++ | 84% ~01s
|+++++++++++++++++++++++++++++++++++++++++++ | 85% ~01s
|+++++++++++++++++++++++++++++++++++++++++++ | 86% ~00s
|++++++++++++++++++++++++++++++++++++++++++++ | 87% ~00s
|++++++++++++++++++++++++++++++++++++++++++++ | 88% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++ | 89% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++ | 90% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++ | 91% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++ | 92% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 93% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 94% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 95% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 96% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=03s
Calculating cluster 6
| | 0 % ~calculating
|+ | 1 % ~02s
|++ | 2 % ~02s
|++ | 3 % ~02s
|+++ | 4 % ~02s
|+++ | 5 % ~02s
|++++ | 6 % ~02s
|++++ | 7 % ~02s
|+++++ | 8 % ~02s
|+++++ | 9 % ~01s
|++++++ | 10% ~01s
|++++++ | 11% ~01s
|+++++++ | 12% ~01s
|+++++++ | 14% ~01s
|++++++++ | 15% ~01s
|++++++++ | 16% ~01s
|+++++++++ | 17% ~01s
|+++++++++ | 18% ~01s
|++++++++++ | 19% ~01s
|++++++++++ | 20% ~01s
|+++++++++++ | 21% ~01s
|+++++++++++ | 22% ~01s
|++++++++++++ | 23% ~01s
|++++++++++++ | 24% ~01s
|+++++++++++++ | 25% ~01s
|++++++++++++++ | 26% ~01s
|++++++++++++++ | 27% ~01s
|+++++++++++++++ | 28% ~01s
|+++++++++++++++ | 29% ~01s
|++++++++++++++++ | 30% ~01s
|++++++++++++++++ | 31% ~01s
|+++++++++++++++++ | 32% ~01s
|+++++++++++++++++ | 33% ~01s
|++++++++++++++++++ | 34% ~01s
|++++++++++++++++++ | 35% ~01s
|+++++++++++++++++++ | 36% ~01s
|+++++++++++++++++++ | 38% ~01s
|++++++++++++++++++++ | 39% ~01s
|++++++++++++++++++++ | 40% ~01s
|+++++++++++++++++++++ | 41% ~01s
|+++++++++++++++++++++ | 42% ~01s
|++++++++++++++++++++++ | 43% ~01s
|++++++++++++++++++++++ | 44% ~01s
|+++++++++++++++++++++++ | 45% ~01s
|+++++++++++++++++++++++ | 46% ~01s
|++++++++++++++++++++++++ | 47% ~01s
|++++++++++++++++++++++++ | 48% ~01s
|+++++++++++++++++++++++++ | 49% ~01s
|+++++++++++++++++++++++++ | 50% ~01s
|++++++++++++++++++++++++++ | 51% ~01s
|+++++++++++++++++++++++++++ | 52% ~01s
|+++++++++++++++++++++++++++ | 53% ~01s
|++++++++++++++++++++++++++++ | 54% ~01s
|++++++++++++++++++++++++++++ | 55% ~01s
|+++++++++++++++++++++++++++++ | 56% ~01s
|+++++++++++++++++++++++++++++ | 57% ~01s
|++++++++++++++++++++++++++++++ | 58% ~01s
|++++++++++++++++++++++++++++++ | 59% ~01s
|+++++++++++++++++++++++++++++++ | 60% ~01s
|+++++++++++++++++++++++++++++++ | 61% ~01s
|++++++++++++++++++++++++++++++++ | 62% ~01s
|++++++++++++++++++++++++++++++++ | 64% ~01s
|+++++++++++++++++++++++++++++++++ | 65% ~01s
|+++++++++++++++++++++++++++++++++ | 66% ~01s
|++++++++++++++++++++++++++++++++++ | 67% ~01s
|++++++++++++++++++++++++++++++++++ | 68% ~01s
|+++++++++++++++++++++++++++++++++++ | 69% ~01s
|+++++++++++++++++++++++++++++++++++ | 70% ~01s
|++++++++++++++++++++++++++++++++++++ | 71% ~00s
|++++++++++++++++++++++++++++++++++++ | 72% ~00s
|+++++++++++++++++++++++++++++++++++++ | 73% ~00s
|+++++++++++++++++++++++++++++++++++++ | 74% ~00s
|++++++++++++++++++++++++++++++++++++++ | 75% ~00s
|+++++++++++++++++++++++++++++++++++++++ | 76% ~00s
|+++++++++++++++++++++++++++++++++++++++ | 77% ~00s
|++++++++++++++++++++++++++++++++++++++++ | 78% ~00s
|++++++++++++++++++++++++++++++++++++++++ | 79% ~00s
|+++++++++++++++++++++++++++++++++++++++++ | 80% ~00s
|+++++++++++++++++++++++++++++++++++++++++ | 81% ~00s
|++++++++++++++++++++++++++++++++++++++++++ | 82% ~00s
|++++++++++++++++++++++++++++++++++++++++++ | 83% ~00s
|+++++++++++++++++++++++++++++++++++++++++++ | 84% ~00s
|+++++++++++++++++++++++++++++++++++++++++++ | 85% ~00s
|++++++++++++++++++++++++++++++++++++++++++++ | 86% ~00s
|++++++++++++++++++++++++++++++++++++++++++++ | 88% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++ | 89% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++ | 90% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++ | 91% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++ | 92% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 93% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 94% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 95% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 96% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=02s
Calculating cluster 7
| | 0 % ~calculating
|+ | 1 % ~03s
|++ | 2 % ~03s
|++ | 3 % ~03s
|+++ | 4 % ~03s
|+++ | 6 % ~03s
|++++ | 7 % ~03s
|++++ | 8 % ~03s
|+++++ | 9 % ~02s
|++++++ | 10% ~02s
|++++++ | 11% ~02s
|+++++++ | 12% ~02s
|+++++++ | 13% ~02s
|++++++++ | 15% ~02s
|++++++++ | 16% ~02s
|+++++++++ | 17% ~02s
|+++++++++ | 18% ~02s
|++++++++++ | 19% ~02s
|+++++++++++ | 20% ~02s
|+++++++++++ | 21% ~02s
|++++++++++++ | 22% ~02s
|++++++++++++ | 24% ~02s
|+++++++++++++ | 25% ~02s
|+++++++++++++ | 26% ~02s
|++++++++++++++ | 27% ~02s
|+++++++++++++++ | 28% ~02s
|+++++++++++++++ | 29% ~02s
|++++++++++++++++ | 30% ~02s
|++++++++++++++++ | 31% ~02s
|+++++++++++++++++ | 33% ~02s
|+++++++++++++++++ | 34% ~02s
|++++++++++++++++++ | 35% ~02s
|++++++++++++++++++ | 36% ~02s
|+++++++++++++++++++ | 37% ~02s
|++++++++++++++++++++ | 38% ~02s
|++++++++++++++++++++ | 39% ~02s
|+++++++++++++++++++++ | 40% ~02s
|+++++++++++++++++++++ | 42% ~02s
|++++++++++++++++++++++ | 43% ~02s
|++++++++++++++++++++++ | 44% ~02s
|+++++++++++++++++++++++ | 45% ~02s
|++++++++++++++++++++++++ | 46% ~01s
|++++++++++++++++++++++++ | 47% ~01s
|+++++++++++++++++++++++++ | 48% ~01s
|+++++++++++++++++++++++++ | 49% ~01s
|++++++++++++++++++++++++++ | 51% ~01s
|++++++++++++++++++++++++++ | 52% ~01s
|+++++++++++++++++++++++++++ | 53% ~01s
|+++++++++++++++++++++++++++ | 54% ~01s
|++++++++++++++++++++++++++++ | 55% ~01s
|+++++++++++++++++++++++++++++ | 56% ~01s
|+++++++++++++++++++++++++++++ | 57% ~01s
|++++++++++++++++++++++++++++++ | 58% ~01s
|++++++++++++++++++++++++++++++ | 60% ~01s
|+++++++++++++++++++++++++++++++ | 61% ~01s
|+++++++++++++++++++++++++++++++ | 62% ~01s
|++++++++++++++++++++++++++++++++ | 63% ~01s
|+++++++++++++++++++++++++++++++++ | 64% ~01s
|+++++++++++++++++++++++++++++++++ | 65% ~01s
|++++++++++++++++++++++++++++++++++ | 66% ~01s
|++++++++++++++++++++++++++++++++++ | 67% ~01s
|+++++++++++++++++++++++++++++++++++ | 69% ~01s
|+++++++++++++++++++++++++++++++++++ | 70% ~01s
|++++++++++++++++++++++++++++++++++++ | 71% ~01s
|++++++++++++++++++++++++++++++++++++ | 72% ~01s
|+++++++++++++++++++++++++++++++++++++ | 73% ~01s
|++++++++++++++++++++++++++++++++++++++ | 74% ~01s
|++++++++++++++++++++++++++++++++++++++ | 75% ~01s
|+++++++++++++++++++++++++++++++++++++++ | 76% ~01s
|+++++++++++++++++++++++++++++++++++++++ | 78% ~01s
|++++++++++++++++++++++++++++++++++++++++ | 79% ~01s
|++++++++++++++++++++++++++++++++++++++++ | 80% ~01s
|+++++++++++++++++++++++++++++++++++++++++ | 81% ~01s
|++++++++++++++++++++++++++++++++++++++++++ | 82% ~00s
|++++++++++++++++++++++++++++++++++++++++++ | 83% ~00s
|+++++++++++++++++++++++++++++++++++++++++++ | 84% ~00s
|+++++++++++++++++++++++++++++++++++++++++++ | 85% ~00s
|++++++++++++++++++++++++++++++++++++++++++++ | 87% ~00s
|++++++++++++++++++++++++++++++++++++++++++++ | 88% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++ | 89% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++ | 90% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++ | 91% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 92% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 93% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 94% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 96% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=03s
Calculating cluster 8
| | 0 % ~calculating
|+ | 1 % ~06s
|++ | 2 % ~05s
|++ | 3 % ~05s
|+++ | 4 % ~05s
|+++ | 5 % ~05s
|++++ | 6 % ~05s
|++++ | 7 % ~05s
|+++++ | 8 % ~05s
|+++++ | 9 % ~05s
|++++++ | 10% ~05s
|++++++ | 11% ~05s
|+++++++ | 12% ~05s
|+++++++ | 14% ~05s
|++++++++ | 15% ~05s
|++++++++ | 16% ~05s
|+++++++++ | 17% ~05s
|+++++++++ | 18% ~04s
|++++++++++ | 19% ~04s
|++++++++++ | 20% ~04s
|+++++++++++ | 21% ~04s
|+++++++++++ | 22% ~04s
|++++++++++++ | 23% ~04s
|++++++++++++ | 24% ~04s
|+++++++++++++ | 25% ~04s
|++++++++++++++ | 26% ~04s
|++++++++++++++ | 27% ~04s
|+++++++++++++++ | 28% ~04s
|+++++++++++++++ | 29% ~04s
|++++++++++++++++ | 30% ~04s
|++++++++++++++++ | 31% ~04s
|+++++++++++++++++ | 32% ~04s
|+++++++++++++++++ | 33% ~04s
|++++++++++++++++++ | 34% ~04s
|++++++++++++++++++ | 35% ~04s
|+++++++++++++++++++ | 36% ~03s
|+++++++++++++++++++ | 38% ~03s
|++++++++++++++++++++ | 39% ~03s
|++++++++++++++++++++ | 40% ~03s
|+++++++++++++++++++++ | 41% ~03s
|+++++++++++++++++++++ | 42% ~03s
|++++++++++++++++++++++ | 43% ~03s
|++++++++++++++++++++++ | 44% ~03s
|+++++++++++++++++++++++ | 45% ~03s
|+++++++++++++++++++++++ | 46% ~03s
|++++++++++++++++++++++++ | 47% ~03s
|++++++++++++++++++++++++ | 48% ~03s
|+++++++++++++++++++++++++ | 49% ~03s
|+++++++++++++++++++++++++ | 50% ~03s
|++++++++++++++++++++++++++ | 51% ~03s
|+++++++++++++++++++++++++++ | 52% ~03s
|+++++++++++++++++++++++++++ | 53% ~03s
|++++++++++++++++++++++++++++ | 54% ~03s
|++++++++++++++++++++++++++++ | 55% ~02s
|+++++++++++++++++++++++++++++ | 56% ~02s
|+++++++++++++++++++++++++++++ | 57% ~02s
|++++++++++++++++++++++++++++++ | 58% ~02s
|++++++++++++++++++++++++++++++ | 59% ~02s
|+++++++++++++++++++++++++++++++ | 60% ~02s
|+++++++++++++++++++++++++++++++ | 61% ~02s
|++++++++++++++++++++++++++++++++ | 62% ~02s
|++++++++++++++++++++++++++++++++ | 64% ~02s
|+++++++++++++++++++++++++++++++++ | 65% ~02s
|+++++++++++++++++++++++++++++++++ | 66% ~02s
|++++++++++++++++++++++++++++++++++ | 67% ~02s
|++++++++++++++++++++++++++++++++++ | 68% ~02s
|+++++++++++++++++++++++++++++++++++ | 69% ~02s
|+++++++++++++++++++++++++++++++++++ | 70% ~02s
|++++++++++++++++++++++++++++++++++++ | 71% ~02s
|++++++++++++++++++++++++++++++++++++ | 72% ~02s
|+++++++++++++++++++++++++++++++++++++ | 73% ~01s
|+++++++++++++++++++++++++++++++++++++ | 74% ~01s
|++++++++++++++++++++++++++++++++++++++ | 75% ~01s
|+++++++++++++++++++++++++++++++++++++++ | 76% ~01s
|+++++++++++++++++++++++++++++++++++++++ | 77% ~01s
|++++++++++++++++++++++++++++++++++++++++ | 78% ~01s
|++++++++++++++++++++++++++++++++++++++++ | 79% ~01s
|+++++++++++++++++++++++++++++++++++++++++ | 80% ~01s
|+++++++++++++++++++++++++++++++++++++++++ | 81% ~01s
|++++++++++++++++++++++++++++++++++++++++++ | 82% ~01s
|++++++++++++++++++++++++++++++++++++++++++ | 83% ~01s
|+++++++++++++++++++++++++++++++++++++++++++ | 84% ~01s
|+++++++++++++++++++++++++++++++++++++++++++ | 85% ~01s
|++++++++++++++++++++++++++++++++++++++++++++ | 86% ~01s
|++++++++++++++++++++++++++++++++++++++++++++ | 88% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++ | 89% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++ | 90% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++ | 91% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++ | 92% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 93% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 94% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 95% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 96% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=05s
Calculating cluster 9
| | 0 % ~calculating
|++ | 2 % ~00s
|+++ | 5 % ~00s
|++++ | 7 % ~00s
|+++++ | 10% ~00s
|++++++ | 12% ~00s
|++++++++ | 14% ~00s
|+++++++++ | 17% ~00s
|++++++++++ | 19% ~00s
|+++++++++++ | 21% ~00s
|++++++++++++ | 24% ~00s
|++++++++++++++ | 26% ~00s
|+++++++++++++++ | 29% ~00s
|++++++++++++++++ | 31% ~00s
|+++++++++++++++++ | 33% ~00s
|++++++++++++++++++ | 36% ~00s
|++++++++++++++++++++ | 38% ~00s
|+++++++++++++++++++++ | 40% ~00s
|++++++++++++++++++++++ | 43% ~00s
|+++++++++++++++++++++++ | 45% ~00s
|++++++++++++++++++++++++ | 48% ~00s
|+++++++++++++++++++++++++ | 50% ~00s
|+++++++++++++++++++++++++++ | 52% ~00s
|++++++++++++++++++++++++++++ | 55% ~00s
|+++++++++++++++++++++++++++++ | 57% ~00s
|++++++++++++++++++++++++++++++ | 60% ~00s
|+++++++++++++++++++++++++++++++ | 62% ~00s
|+++++++++++++++++++++++++++++++++ | 64% ~00s
|++++++++++++++++++++++++++++++++++ | 67% ~00s
|+++++++++++++++++++++++++++++++++++ | 69% ~00s
|++++++++++++++++++++++++++++++++++++ | 71% ~00s
|+++++++++++++++++++++++++++++++++++++ | 74% ~00s
|+++++++++++++++++++++++++++++++++++++++ | 76% ~00s
|++++++++++++++++++++++++++++++++++++++++ | 79% ~00s
|+++++++++++++++++++++++++++++++++++++++++ | 81% ~00s
|++++++++++++++++++++++++++++++++++++++++++ | 83% ~00s
|+++++++++++++++++++++++++++++++++++++++++++ | 86% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++ | 88% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++ | 90% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 93% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 95% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=00s
Calculating cluster 10
| | 0 % ~calculating
|+ | 1 % ~08s
|++ | 2 % ~07s
|++ | 3 % ~07s
|+++ | 4 % ~07s
|+++ | 5 % ~07s
|++++ | 6 % ~07s
|++++ | 7 % ~07s
|+++++ | 9 % ~07s
|+++++ | 10% ~07s
|++++++ | 11% ~07s
|++++++ | 12% ~07s
|+++++++ | 13% ~07s
|+++++++ | 14% ~07s
|++++++++ | 15% ~06s
|++++++++ | 16% ~06s
|+++++++++ | 17% ~06s
|++++++++++ | 18% ~06s
|++++++++++ | 19% ~06s
|+++++++++++ | 20% ~06s
|+++++++++++ | 21% ~06s
|++++++++++++ | 22% ~06s
|++++++++++++ | 23% ~06s
|+++++++++++++ | 24% ~06s
|+++++++++++++ | 26% ~06s
|++++++++++++++ | 27% ~06s
|++++++++++++++ | 28% ~06s
|+++++++++++++++ | 29% ~05s
|+++++++++++++++ | 30% ~05s
|++++++++++++++++ | 31% ~05s
|++++++++++++++++ | 32% ~05s
|+++++++++++++++++ | 33% ~05s
|++++++++++++++++++ | 34% ~05s
|++++++++++++++++++ | 35% ~05s
|+++++++++++++++++++ | 36% ~05s
|+++++++++++++++++++ | 37% ~05s
|++++++++++++++++++++ | 38% ~05s
|++++++++++++++++++++ | 39% ~05s
|+++++++++++++++++++++ | 40% ~05s
|+++++++++++++++++++++ | 41% ~04s
|++++++++++++++++++++++ | 43% ~04s
|++++++++++++++++++++++ | 44% ~04s
|+++++++++++++++++++++++ | 45% ~04s
|+++++++++++++++++++++++ | 46% ~04s
|++++++++++++++++++++++++ | 47% ~04s
|++++++++++++++++++++++++ | 48% ~04s
|+++++++++++++++++++++++++ | 49% ~04s
|+++++++++++++++++++++++++ | 50% ~04s
|++++++++++++++++++++++++++ | 51% ~04s
|+++++++++++++++++++++++++++ | 52% ~04s
|+++++++++++++++++++++++++++ | 53% ~04s
|++++++++++++++++++++++++++++ | 54% ~03s
|++++++++++++++++++++++++++++ | 55% ~03s
|+++++++++++++++++++++++++++++ | 56% ~03s
|+++++++++++++++++++++++++++++ | 57% ~03s
|++++++++++++++++++++++++++++++ | 59% ~03s
|++++++++++++++++++++++++++++++ | 60% ~03s
|+++++++++++++++++++++++++++++++ | 61% ~03s
|+++++++++++++++++++++++++++++++ | 62% ~03s
|++++++++++++++++++++++++++++++++ | 63% ~03s
|++++++++++++++++++++++++++++++++ | 64% ~03s
|+++++++++++++++++++++++++++++++++ | 65% ~03s
|+++++++++++++++++++++++++++++++++ | 66% ~03s
|++++++++++++++++++++++++++++++++++ | 67% ~03s
|+++++++++++++++++++++++++++++++++++ | 68% ~02s
|+++++++++++++++++++++++++++++++++++ | 69% ~02s
|++++++++++++++++++++++++++++++++++++ | 70% ~02s
|++++++++++++++++++++++++++++++++++++ | 71% ~02s
|+++++++++++++++++++++++++++++++++++++ | 72% ~02s
|+++++++++++++++++++++++++++++++++++++ | 73% ~02s
|++++++++++++++++++++++++++++++++++++++ | 74% ~02s
|++++++++++++++++++++++++++++++++++++++ | 76% ~02s
|+++++++++++++++++++++++++++++++++++++++ | 77% ~02s
|+++++++++++++++++++++++++++++++++++++++ | 78% ~02s
|++++++++++++++++++++++++++++++++++++++++ | 79% ~02s
|++++++++++++++++++++++++++++++++++++++++ | 80% ~02s
|+++++++++++++++++++++++++++++++++++++++++ | 81% ~01s
|+++++++++++++++++++++++++++++++++++++++++ | 82% ~01s
|++++++++++++++++++++++++++++++++++++++++++ | 83% ~01s
|+++++++++++++++++++++++++++++++++++++++++++ | 84% ~01s
|+++++++++++++++++++++++++++++++++++++++++++ | 85% ~01s
|++++++++++++++++++++++++++++++++++++++++++++ | 86% ~01s
|++++++++++++++++++++++++++++++++++++++++++++ | 87% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++ | 88% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++ | 89% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++ | 90% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++ | 91% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 93% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 94% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 95% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 96% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=08s
Calculating cluster 11
| | 0 % ~calculating
|+ | 1 % ~20s
|++ | 2 % ~20s
|++ | 3 % ~19s
|+++ | 4 % ~19s
|+++ | 5 % ~19s
|++++ | 6 % ~19s
|++++ | 7 % ~19s
|+++++ | 8 % ~19s
|+++++ | 9 % ~18s
|++++++ | 10% ~18s
|++++++ | 11% ~18s
|+++++++ | 12% ~18s
|+++++++ | 13% ~18s
|++++++++ | 14% ~17s
|++++++++ | 15% ~17s
|+++++++++ | 16% ~17s
|+++++++++ | 18% ~17s
|++++++++++ | 19% ~16s
|++++++++++ | 20% ~16s
|+++++++++++ | 21% ~16s
|+++++++++++ | 22% ~16s
|++++++++++++ | 23% ~16s
|++++++++++++ | 24% ~15s
|+++++++++++++ | 25% ~15s
|+++++++++++++ | 26% ~15s
|++++++++++++++ | 27% ~15s
|++++++++++++++ | 28% ~15s
|+++++++++++++++ | 29% ~14s
|+++++++++++++++ | 30% ~14s
|++++++++++++++++ | 31% ~14s
|++++++++++++++++ | 32% ~14s
|+++++++++++++++++ | 33% ~14s
|++++++++++++++++++ | 34% ~13s
|++++++++++++++++++ | 35% ~13s
|+++++++++++++++++++ | 36% ~13s
|+++++++++++++++++++ | 37% ~13s
|++++++++++++++++++++ | 38% ~13s
|++++++++++++++++++++ | 39% ~12s
|+++++++++++++++++++++ | 40% ~12s
|+++++++++++++++++++++ | 41% ~12s
|++++++++++++++++++++++ | 42% ~12s
|++++++++++++++++++++++ | 43% ~12s
|+++++++++++++++++++++++ | 44% ~11s
|+++++++++++++++++++++++ | 45% ~11s
|++++++++++++++++++++++++ | 46% ~11s
|++++++++++++++++++++++++ | 47% ~11s
|+++++++++++++++++++++++++ | 48% ~11s
|+++++++++++++++++++++++++ | 49% ~10s
|++++++++++++++++++++++++++ | 51% ~10s
|++++++++++++++++++++++++++ | 52% ~10s
|+++++++++++++++++++++++++++ | 53% ~10s
|+++++++++++++++++++++++++++ | 54% ~09s
|++++++++++++++++++++++++++++ | 55% ~09s
|++++++++++++++++++++++++++++ | 56% ~09s
|+++++++++++++++++++++++++++++ | 57% ~09s
|+++++++++++++++++++++++++++++ | 58% ~09s
|++++++++++++++++++++++++++++++ | 59% ~08s
|++++++++++++++++++++++++++++++ | 60% ~08s
|+++++++++++++++++++++++++++++++ | 61% ~08s
|+++++++++++++++++++++++++++++++ | 62% ~08s
|++++++++++++++++++++++++++++++++ | 63% ~08s
|++++++++++++++++++++++++++++++++ | 64% ~07s
|+++++++++++++++++++++++++++++++++ | 65% ~07s
|+++++++++++++++++++++++++++++++++ | 66% ~07s
|++++++++++++++++++++++++++++++++++ | 67% ~07s
|+++++++++++++++++++++++++++++++++++ | 68% ~07s
|+++++++++++++++++++++++++++++++++++ | 69% ~06s
|++++++++++++++++++++++++++++++++++++ | 70% ~06s
|++++++++++++++++++++++++++++++++++++ | 71% ~06s
|+++++++++++++++++++++++++++++++++++++ | 72% ~06s
|+++++++++++++++++++++++++++++++++++++ | 73% ~05s
|++++++++++++++++++++++++++++++++++++++ | 74% ~05s
|++++++++++++++++++++++++++++++++++++++ | 75% ~05s
|+++++++++++++++++++++++++++++++++++++++ | 76% ~05s
|+++++++++++++++++++++++++++++++++++++++ | 77% ~05s
|++++++++++++++++++++++++++++++++++++++++ | 78% ~04s
|++++++++++++++++++++++++++++++++++++++++ | 79% ~04s
|+++++++++++++++++++++++++++++++++++++++++ | 80% ~04s
|+++++++++++++++++++++++++++++++++++++++++ | 81% ~04s
|++++++++++++++++++++++++++++++++++++++++++ | 82% ~04s
|++++++++++++++++++++++++++++++++++++++++++ | 84% ~03s
|+++++++++++++++++++++++++++++++++++++++++++ | 85% ~03s
|+++++++++++++++++++++++++++++++++++++++++++ | 86% ~03s
|++++++++++++++++++++++++++++++++++++++++++++ | 87% ~03s
|++++++++++++++++++++++++++++++++++++++++++++ | 88% ~03s
|+++++++++++++++++++++++++++++++++++++++++++++ | 89% ~02s
|+++++++++++++++++++++++++++++++++++++++++++++ | 90% ~02s
|++++++++++++++++++++++++++++++++++++++++++++++ | 91% ~02s
|++++++++++++++++++++++++++++++++++++++++++++++ | 92% ~02s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 93% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 94% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 95% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 96% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=20s
Calculating cluster 12
| | 0 % ~calculating
|+ | 1 % ~10s
|+ | 2 % ~10s
|++ | 3 % ~09s
|++ | 4 % ~09s
|+++ | 5 % ~09s
|+++ | 6 % ~09s
|++++ | 7 % ~09s
|++++ | 8 % ~09s
|+++++ | 9 % ~09s
|+++++ | 10% ~08s
|++++++ | 11% ~08s
|++++++ | 12% ~08s
|+++++++ | 13% ~08s
|+++++++ | 14% ~08s
|++++++++ | 15% ~08s
|++++++++ | 16% ~08s
|+++++++++ | 17% ~08s
|+++++++++ | 18% ~08s
|++++++++++ | 19% ~08s
|++++++++++ | 20% ~08s
|+++++++++++ | 21% ~07s
|+++++++++++ | 22% ~07s
|++++++++++++ | 23% ~07s
|++++++++++++ | 24% ~07s
|+++++++++++++ | 25% ~07s
|+++++++++++++ | 26% ~07s
|++++++++++++++ | 27% ~07s
|++++++++++++++ | 28% ~07s
|+++++++++++++++ | 29% ~07s
|+++++++++++++++ | 30% ~07s
|++++++++++++++++ | 31% ~07s
|++++++++++++++++ | 32% ~07s
|+++++++++++++++++ | 33% ~06s
|+++++++++++++++++ | 34% ~06s
|++++++++++++++++++ | 35% ~06s
|++++++++++++++++++ | 36% ~06s
|+++++++++++++++++++ | 37% ~06s
|+++++++++++++++++++ | 38% ~06s
|++++++++++++++++++++ | 39% ~06s
|++++++++++++++++++++ | 40% ~06s
|+++++++++++++++++++++ | 41% ~06s
|+++++++++++++++++++++ | 42% ~06s
|++++++++++++++++++++++ | 43% ~05s
|++++++++++++++++++++++ | 44% ~05s
|+++++++++++++++++++++++ | 45% ~05s
|+++++++++++++++++++++++ | 46% ~05s
|++++++++++++++++++++++++ | 47% ~05s
|++++++++++++++++++++++++ | 48% ~05s
|+++++++++++++++++++++++++ | 49% ~05s
|+++++++++++++++++++++++++ | 50% ~05s
|++++++++++++++++++++++++++ | 51% ~05s
|++++++++++++++++++++++++++ | 52% ~05s
|+++++++++++++++++++++++++++ | 53% ~05s
|+++++++++++++++++++++++++++ | 54% ~04s
|++++++++++++++++++++++++++++ | 55% ~04s
|++++++++++++++++++++++++++++ | 56% ~04s
|+++++++++++++++++++++++++++++ | 57% ~04s
|+++++++++++++++++++++++++++++ | 58% ~04s
|++++++++++++++++++++++++++++++ | 59% ~04s
|++++++++++++++++++++++++++++++ | 60% ~04s
|+++++++++++++++++++++++++++++++ | 61% ~04s
|+++++++++++++++++++++++++++++++ | 62% ~04s
|++++++++++++++++++++++++++++++++ | 63% ~04s
|++++++++++++++++++++++++++++++++ | 64% ~03s
|+++++++++++++++++++++++++++++++++ | 65% ~03s
|+++++++++++++++++++++++++++++++++ | 66% ~03s
|++++++++++++++++++++++++++++++++++ | 67% ~03s
|++++++++++++++++++++++++++++++++++ | 68% ~03s
|+++++++++++++++++++++++++++++++++++ | 69% ~03s
|+++++++++++++++++++++++++++++++++++ | 70% ~03s
|++++++++++++++++++++++++++++++++++++ | 71% ~03s
|++++++++++++++++++++++++++++++++++++ | 72% ~03s
|+++++++++++++++++++++++++++++++++++++ | 73% ~03s
|+++++++++++++++++++++++++++++++++++++ | 74% ~03s
|++++++++++++++++++++++++++++++++++++++ | 75% ~02s
|++++++++++++++++++++++++++++++++++++++ | 76% ~02s
|+++++++++++++++++++++++++++++++++++++++ | 77% ~02s
|+++++++++++++++++++++++++++++++++++++++ | 78% ~02s
|++++++++++++++++++++++++++++++++++++++++ | 79% ~02s
|++++++++++++++++++++++++++++++++++++++++ | 80% ~02s
|+++++++++++++++++++++++++++++++++++++++++ | 81% ~02s
|+++++++++++++++++++++++++++++++++++++++++ | 82% ~02s
|++++++++++++++++++++++++++++++++++++++++++ | 83% ~02s
|++++++++++++++++++++++++++++++++++++++++++ | 84% ~02s
|+++++++++++++++++++++++++++++++++++++++++++ | 85% ~01s
|+++++++++++++++++++++++++++++++++++++++++++ | 86% ~01s
|++++++++++++++++++++++++++++++++++++++++++++ | 87% ~01s
|++++++++++++++++++++++++++++++++++++++++++++ | 88% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++ | 89% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++ | 90% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++ | 91% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++ | 92% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 93% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 94% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 95% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 96% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=10s
top10_markers <- TE001_markers %>% group_by(cluster) %>% top_n(n = 10, wt = avg_log2FC)
genes_default <- top10_markers$gene
Generate a heatmap showing the top 10 differentially expressed genes on a per-cluster basis
# Visualize clusters and top DE genes on a heatmap
mat_to_show_default <- as.matrix(TE001@assays$RNA@data[genes_default,])
Clusters <- TE001$seurat_clusters
colors <- rainbow(nlevels(Clusters))
names(colors) <- levels(Clusters)
# prepare df_annot.df
per.cell.sil.width <- s[,"sil_width"]
names(per.cell.sil.width) <- colnames(TE001)
df_annot.df <- TE001@meta.data %>%
dplyr::select(cluster_id=seurat_clusters, cytotrace_score = cytotrace_te001) %>%
tibble::rownames_to_column(.,var="cell_id")
df_annot.df$cluster_id <- factor(as.numeric(df_annot.df$cluster_id))
x <- as.data.frame(per.cell.sil.width) %>%
tibble::rownames_to_column(.,var="sample_id")
df_annot.df <- left_join(df_annot.df,x,by=c("cell_id"="sample_id"))
sample_ordering_to_print <- rev( order( df_annot.df$per.cell.sil.width ) )
df_annot.df <- df_annot.df[sample_ordering_to_print,]
mat_to_show_default <- mat_to_show_default[,match(df_annot.df$cell_id,colnames(mat_to_show_default))]
stopifnot(identical( df_annot.df$cell_id, colnames(mat_to_show_default) ))
# the silhouette score
sil.fill <- rep(NA, nrow(df_annot.df))
unique_clusters <- unique(df_annot.df$cluster_id)
n_colors <- length(colors)
color_index <- 1
for (i in seq_along(unique_clusters)) {
cluster <- unique_clusters[i]
sil.fill[df_annot.df$cluster_id == cluster] <- colors[names(colors) == cluster]
color_index <- i + 1 # Use modulo to cycle through colors
}
df_annot_cols_cluster_score <- HeatmapAnnotation(
silhouette_score = anno_barplot(
df_annot.df$per.cell.sil.width,
bar_width = 1,
gp = gpar(col = NA,
fontsize = 6 ,
cex = 0.8 ,
fill = sil.fill
),
border = FALSE,
height = unit(1.25, "cm") ,
width = unit(0.5, "cm")
)
)
# heatmap annotation
df_annot.df <- df_annot.df %>% dplyr::select(cluster_id)
cluster_colors <- colors[ !is.na(names(colors)) ]
df_annot_cols = HeatmapAnnotation( df = df_annot.df,
col = list(cluster_id=cluster_colors) ,
show_legend = TRUE , na_col = "gray95",
annotation_name_gp = gpar(fontsize=0.1)
)
top10_default_hm <- Heatmap( mat_to_show_default,
col = circlize::colorRamp2(range(mat_to_show_default)/2, c("darkslateblue", "yellow")),
use_raster = FALSE ,
column_split = df_annot.df$cluster_id,
heatmap_legend_param = list(color_bar = "continuous") ,
cluster_columns = FALSE ,
cluster_rows = FALSE ,
show_column_names = FALSE ,
name = "Gene Expression (log1p)" ,
row_names_gp = gpar(fontsize = 10) , column_names_gp = gpar(fontsize=8),
row_title_side = "left" , row_title_gp = gpar(fontsize = 10, fontface="bold")
)
ht_top10_list = df_annot_cols_cluster_score %v% df_annot_cols %v% top10_default_hm
pdf(file.path(figures_path,"top_10_default_heatmap.pdf"), width = 15, height = 23)
p <- draw(ht_top10_list, column_km = 1 ,
heatmap_legend_side = "right",
annotation_legend_side = "bottom" )
dev.off()
null device
1
p
Display a dotplot with the top 5 genes per cluster (using the
data slot).
top5_markers <- TE001_markers %>% group_by(cluster) %>% top_n(n = 5, wt = avg_log2FC)
genes_dp_default <- top5_markers$gene %>% unique()
# intialize lists containing dataframes
Avgs_default <- vector( mode="list", length=length(levels(TE001$seurat_clusters)) )
names(Avgs_default) <- levels(TE001$seurat_clusters)
Pct_default <- vector( mode="list", length=length(levels(TE001$seurat_clusters)) )
names(Pct_default) <- levels(TE001$seurat_clusters)
for (cluster in levels(TE001$seurat_clusters)){
cells_in_cluster <- TE001$seurat_clusters == cluster
# Avg_default
Avgs_default[[cluster]] <- TE001[["RNA"]]@data[genes_dp_default, cells_in_cluster] %>%
rowMeans() %>%
as.data.frame() %>%
rownames_to_column() %>%
dplyr::rename(.,"Gene"=rowname,"mean"=.) %>%
dplyr::mutate(cluster=cluster)
# Pct
Pct_default[[cluster]] <- TE001[["RNA"]]@data[genes_dp_default, cells_in_cluster] %>%
apply(.,1, function(x){ sum(x>0)/length(x)*100 }) %>%
as.data.frame() %>%
rownames_to_column() %>%
dplyr::rename(.,"Gene"=rowname,"Pct"=.) %>%
dplyr::mutate(cluster=cluster)
}
# Mean
df_mean.GEx_default <- do.call(rbind, Avgs_default)
rownames(df_mean.GEx_default) <- NULL
# Pct
df_pct.GEx_default <- do.call(rbind, Pct_default)
rownames(df_pct.GEx_default) <- NULL
# Summary
summary.GEx_default <- cbind(df_mean.GEx_default[,1:2],df_pct.GEx_default[,2:3])
summary.GEx_default$Gene <- factor(summary.GEx_default$Gene, levels=genes_dp_default, ordered = TRUE)
# Printing dotplot for genes
cat("Printing dotplots..\n")
Printing dotplots..
GEx.DGE_DotPlot_default <- ggplot(summary.GEx_default, aes(x=Gene,y=cluster)) +
geom_point(aes(size = Pct, fill= mean), color="black", shape=21) +
scale_size("% detected", range = c(0,15), breaks=c(0,25,50,75,100), limits=c(0,100)) +
scale_fill_gradient2(low="steelblue1", high = "red", mid="white",midpoint=0,
limits=range(summary.GEx_default$mean),
guide = guide_colorbar(ticks.colour = "black",
frame.colour = "black"),
name = "Average Expression\nlog1p(counts)") +
ylab("Cluster") + xlab("") +
theme_bw() +
theme(axis.text.x = element_text(size=10, angle=45, hjust=1, color="black"),
axis.text.y = element_text(size=12, color="black"),
axis.title = element_text(size=14) ,
panel.grid.major = element_blank(), panel.grid.minor = element_blank()
)
pdf(file.path(figures_path, "GEx-DGE-dotplot_default.pdf") , width = 25 , height = 9)
print(GEx.DGE_DotPlot_default)
dev.off()
null device
1
print(GEx.DGE_DotPlot_default)
Scale data with SCTransform and compute PCA.
# new PCA and UMAP will be computed
TE001@reductions$pca <- NULL
TE001@reductions$umap <- NULL
TE001 <- SCTransform(object=TE001,
assay="RNA",
ncells=ncol(TE001),
variable.features.n = length(all.genes),
do.center = TRUE,
do.scale = TRUE,
conserve.memory = TRUE)
Calculating cell attributes from input UMI matrix: log_umi
Variance stabilizing transformation of count matrix of size 15224 by 3656
Model formula is y ~ log_umi
Get Negative Binomial regression parameters per gene
Using 2000 genes, 3656 cells
|
| | 0%
|
|==================================== | 25%
|
|======================================================================= | 50%
|
|========================================================================================================== | 75%
|
|==============================================================================================================================================| 100%
Found 113 outliers - those will be ignored in fitting/regularization step
Skip calculation of full residual matrix
Will not return corrected UMI because residual type is not set to 'pearson'
Calculating gene attributes
Wall clock passed: Time difference of 13.81408 secs
Setting min_variance to: -Inf
Calculating variance for residuals of type pearson for 15224 genes
|
| | 0%
|
|== | 2%
|
|===== | 3%
|
|======= | 5%
|
|========= | 7%
|
|============ | 8%
|
|============== | 10%
|
|================= | 12%
|
|=================== | 13%
|
|===================== | 15%
|
|======================== | 17%
|
|========================== | 18%
|
|============================ | 20%
|
|=============================== | 22%
|
|================================= | 23%
|
|==================================== | 25%
|
|====================================== | 27%
|
|======================================== | 28%
|
|=========================================== | 30%
|
|============================================= | 32%
|
|=============================================== | 33%
|
|================================================== | 35%
|
|==================================================== | 37%
|
|====================================================== | 38%
|
|========================================================= | 40%
|
|=========================================================== | 42%
|
|============================================================== | 43%
|
|================================================================ | 45%
|
|================================================================== | 47%
|
|===================================================================== | 48%
|
|======================================================================= | 50%
|
|========================================================================= | 52%
|
|============================================================================ | 53%
|
|============================================================================== | 55%
|
|================================================================================ | 57%
|
|=================================================================================== | 58%
|
|===================================================================================== | 60%
|
|======================================================================================== | 62%
|
|========================================================================================== | 63%
|
|============================================================================================ | 65%
|
|=============================================================================================== | 67%
|
|================================================================================================= | 68%
|
|=================================================================================================== | 70%
|
|====================================================================================================== | 72%
|
|======================================================================================================== | 73%
|
|========================================================================================================== | 75%
|
|============================================================================================================= | 77%
|
|=============================================================================================================== | 78%
|
|================================================================================================================== | 80%
|
|==================================================================================================================== | 82%
|
|====================================================================================================================== | 83%
|
|========================================================================================================================= | 85%
|
|=========================================================================================================================== | 87%
|
|============================================================================================================================= | 88%
|
|================================================================================================================================ | 90%
|
|================================================================================================================================== | 92%
|
|===================================================================================================================================== | 93%
|
|======================================================================================================================================= | 95%
|
|========================================================================================================================================= | 97%
|
|============================================================================================================================================ | 98%
|
|==============================================================================================================================================| 100%
Determine variable features
Setting min_variance to: -Inf
Calculating residuals of type pearson for 15224 genes
|
| | 0%
|
|== | 2%
|
|===== | 3%
|
|======= | 5%
|
|========= | 7%
|
|============ | 8%
|
|============== | 10%
|
|================= | 12%
|
|=================== | 13%
|
|===================== | 15%
|
|======================== | 17%
|
|========================== | 18%
|
|============================ | 20%
|
|=============================== | 22%
|
|================================= | 23%
|
|==================================== | 25%
|
|====================================== | 27%
|
|======================================== | 28%
|
|=========================================== | 30%
|
|============================================= | 32%
|
|=============================================== | 33%
|
|================================================== | 35%
|
|==================================================== | 37%
|
|====================================================== | 38%
|
|========================================================= | 40%
|
|=========================================================== | 42%
|
|============================================================== | 43%
|
|================================================================ | 45%
|
|================================================================== | 47%
|
|===================================================================== | 48%
|
|======================================================================= | 50%
|
|========================================================================= | 52%
|
|============================================================================ | 53%
|
|============================================================================== | 55%
|
|================================================================================ | 57%
|
|=================================================================================== | 58%
|
|===================================================================================== | 60%
|
|======================================================================================== | 62%
|
|========================================================================================== | 63%
|
|============================================================================================ | 65%
|
|=============================================================================================== | 67%
|
|================================================================================================= | 68%
|
|=================================================================================================== | 70%
|
|====================================================================================================== | 72%
|
|======================================================================================================== | 73%
|
|========================================================================================================== | 75%
|
|============================================================================================================= | 77%
|
|=============================================================================================================== | 78%
|
|================================================================================================================== | 80%
|
|==================================================================================================================== | 82%
|
|====================================================================================================================== | 83%
|
|========================================================================================================================= | 85%
|
|=========================================================================================================================== | 87%
|
|============================================================================================================================= | 88%
|
|================================================================================================================================ | 90%
|
|================================================================================================================================== | 92%
|
|===================================================================================================================================== | 93%
|
|======================================================================================================================================= | 95%
|
|========================================================================================================================================= | 97%
|
|============================================================================================================================================ | 98%
|
|==============================================================================================================================================| 100%
Computing corrected UMI count matrix
|
| | 0%
|
|===== | 3%
|
|========= | 6%
|
|============== | 10%
|
|================== | 13%
|
|======================= | 16%
|
|=========================== | 19%
|
|================================ | 23%
|
|===================================== | 26%
|
|========================================= | 29%
|
|============================================== | 32%
|
|================================================== | 35%
|
|======================================================= | 39%
|
|============================================================ | 42%
|
|================================================================ | 45%
|
|===================================================================== | 48%
|
|========================================================================= | 52%
|
|============================================================================== | 55%
|
|================================================================================== | 58%
|
|======================================================================================= | 61%
|
|============================================================================================ | 65%
|
|================================================================================================ | 68%
|
|===================================================================================================== | 71%
|
|========================================================================================================= | 74%
|
|============================================================================================================== | 77%
|
|=================================================================================================================== | 81%
|
|======================================================================================================================= | 84%
|
|============================================================================================================================ | 87%
|
|================================================================================================================================ | 90%
|
|===================================================================================================================================== | 94%
|
|========================================================================================================================================= | 97%
|
|==============================================================================================================================================| 100%
Place corrected count matrix in counts slot
Centering and scaling data matrix
|
| | 0%
|
|======= | 5%
|
|============== | 10%
|
|==================== | 14%
|
|=========================== | 19%
|
|================================== | 24%
|
|========================================= | 29%
|
|=============================================== | 33%
|
|====================================================== | 38%
|
|============================================================= | 43%
|
|==================================================================== | 48%
|
|========================================================================== | 52%
|
|================================================================================= | 57%
|
|======================================================================================== | 62%
|
|=============================================================================================== | 67%
|
|===================================================================================================== | 71%
|
|============================================================================================================ | 76%
|
|=================================================================================================================== | 81%
|
|========================================================================================================================== | 86%
|
|================================================================================================================================ | 90%
|
|======================================================================================================================================= | 95%
|
|==============================================================================================================================================| 100%
Set default assay to SCT
TE001 <- RunPCA(TE001, features=all.genes, verbose=F)
Compute clustering solution at the gene expression level by
optimizing the silhouette score with acdc. Bigger clusters
(>100 cells) are subclustered in a second step for finer grain cell
type assignment.
Clustering (iteration 1):
if (running_clustering == TRUE){
cat("Computing clustering solution at gene expression..\n")
control <- list(maxit=1e4,
smooth=FALSE,
max.time=60*30,
temperature=1e9)
TE001 <- SAClustering(S.obj = TE001,
assay="SCT",
control=control,
type.fun = "group.mean.silhouette")
opt_param <- TE001@assays$SCT@misc$SA.history$optim.par # res, NN
} else if (running_clustering == FALSE){
cat("Using previously identified optimal solution at gene expression, without recomputing it..\n")
TE001 <- getFinal(S.obj = TE001,
assay="SCT",
res=opt_param[1],
NN=opt_param[2],
type.fun="group.mean.silhouette")
}
Using previously identified optimal solution at gene expression, without recomputing it..
# rename clusters such that levels start from 1 instead of 0, just for consistency
levels(TE001$seurat_clusters) <- as.character(as.numeric(levels(TE001$seurat_clusters)) + 1)
Display the silhouette after the first clustering iteration.
npcs <- dim( TE001@reductions$pca@cell.embeddings )[2]
PCs<-as.data.frame(TE001$pca@cell.embeddings[,1:npcs])
euc_distance<-dist(PCs, method="euclidean")
s <- silhouette( as.integer(TE001$seurat_clusters) , euc_distance )
pdf(file.path(figures_path, "step_1_silhouette.pdf") , width = 6 , height = 8)
fviz_silhouette(s,print.summary = FALSE)
dev.off()
null device
1
fviz_silhouette(s,print.summary = FALSE)
Show clustering solution after the first iteration on a UMAP embeddings. The first UMAP visualization is the one computed at gene expression level, the second UMAP visualization is the one computed at protein activity.
npcs <- dim( TE001@reductions$pca@cell.embeddings )[2]
TE001 <- RunUMAP(TE001, dims = 1:npcs, verbose=F)
pdf(file.path(figures_path,"step_1_clustering_umap.pdf"), width = 12, height = 6) # Adjust width and height as needed
DimPlot(TE001, group.by=c("seurat_clusters", "iter_cluster_id_with_paneth"), reduction="umap", pt.size=1.5)
dev.off()
null device
1
DimPlot(TE001, group.by=c("seurat_clusters", "iter_cluster_id_with_paneth"), reduction="umap", pt.size=1.5)
TE001@reductions$umap@cell.embeddings <- as.matrix( TE001@meta.data[c("UMAP_1_scanpy","UMAP_2_scanpy")] )
colnames(TE001@reductions$umap@cell.embeddings) <- c("UMAP_1", "UMAP_2")
pdf(file.path(figures_path,"step_1_clustering_umap_pa.pdf"), width = 12, height = 6)
DimPlot(TE001, group.by=c("seurat_clusters", "iter_cluster_id_with_paneth"), reduction="umap", pt.size=1.5)
dev.off()
quartz_off_screen
2
DimPlot(TE001, group.by=c("seurat_clusters", "iter_cluster_id_with_paneth"), reduction="umap", pt.size=1.5)
Clustering (iteration 2):
# Split by cluster and subcluster
TE001_list <- SplitObject(object=TE001, split.by="seurat_clusters")
TE001_clusters <- TE001$seurat_clusters %>% unique()
cat("Subclustering only clusters with at least 100 cells..\n")
Subclustering only clusters with at least 100 cells..
n_cells_per_cluster <- sapply(TE001_list, function(x){dim(x)[2]})
TE001_clusters_to_subcluster <- TE001_clusters[n_cells_per_cluster >=100]
if (running_clustering == TRUE){
optim_par_list <- matrix(NA, nrow=length(TE001_clusters_to_subcluster), ncol=2)
colnames(optim_par_list) <- c("res", "NN")
rownames(optim_par_list) <- as.character(TE001_clusters_to_subcluster)
cat("Subclustering on a cluster by cluster basis..\n")
for (k in TE001_clusters_to_subcluster){
TE001_list[[k]] <- SAClustering(S.obj = TE001_list[[k]],
assay="SCT",
control=control,
type.fun = "group.mean.silhouette")
# rename clusters such that levels start from 1 instead of 0
levels(TE001_list[[k]]@meta.data$seurat_clusters) <- as.character(as.numeric(levels(TE001_list[[k]]@meta.data$seurat_clusters)) + 1)
# store name for branching
TE001_list[[k]]@meta.data$seurat_clusters <- paste0(k,"_",TE001_list[[k]]@meta.data$seurat_clusters)
optim_par_list[k,] <- TE001_list[[k]]@assays$SCT@misc$SA.history$optim.par # res, NN
}
} else if (running_clustering == FALSE){
cat("Subclustering on a cluster by cluster basis by using the previously optimized clustering parameters..\n")
for (k in TE001_clusters_to_subcluster){
opt_res <- optim_par_list[k,"res"]
opt_NN <- optim_par_list[k,"NN"]
TE001_list[[k]] <- getFinal(S.obj = TE001_list[[k]],
assay="SCT",
res=opt_res,
NN=opt_NN,
type.fun = "group.mean.silhouette")
levels(TE001_list[[k]]@meta.data$seurat_clusters) <- as.character(as.numeric(levels(TE001_list[[k]]@meta.data$seurat_clusters)) + 1)
TE001_list[[k]]@meta.data$seurat_clusters <- paste0(k,"_",TE001_list[[k]]@meta.data$seurat_clusters)
}
}
Subclustering on a cluster by cluster basis by using the previously optimized clustering parameters..
TE001_list[[k]]@meta.data$seurat_clusters <- as.factor(TE001_list[[k]]@meta.data$seurat_clusters)
# remerge Seurat objects into one Seurat object
TE001_subclustering <- merge(x=TE001_list[[1]],
y=TE001_list[2:length(TE001_list)])
Display the silhouette after the second clustering iteration.
# Re-run PCA to visualize it
TE001_subclustering <- RunPCA(TE001_subclustering, features=all.genes, verbose=F)
npcs <- dim( TE001_subclustering@reductions$pca@cell.embeddings )[2]
PCs<-as.data.frame(TE001_subclustering$pca@cell.embeddings[,1:npcs])
euc_distance<-dist(PCs, method="euclidean")
TE001_subclustering@meta.data$seurat_clusters <- as.factor(TE001_subclustering@meta.data$seurat_clusters)
s <- silhouette( as.integer(TE001_subclustering$seurat_clusters) , euc_distance )
pdf(file.path(figures_path, "step_2_silhouette.pdf") , width = 6 , height = 8)
fviz_silhouette(s,print.summary = FALSE)
dev.off()
null device
1
fviz_silhouette(s,print.summary = FALSE)
Show clustering solution after the first iteration on a UMAP embeddings. The first UMAP visualization is the one computed at gene expression level, the second UMAP visualization is the one computed at protein activity.
TE001_subclustering <- RunUMAP(TE001_subclustering, dims = 1:npcs, verbose=F)
pdf(file.path(figures_path,"step_2_clustering_umap.pdf"), width = 12, height = 6)
DimPlot(TE001_subclustering, group.by=c("seurat_clusters", "iter_cluster_id_with_paneth"),
reduction="umap", pt.size=1.5 )
dev.off()
null device
1
DimPlot(TE001_subclustering, group.by=c("seurat_clusters", "iter_cluster_id_with_paneth"),
reduction="umap", pt.size=1.5 )
TE001_subclustering@reductions$umap@cell.embeddings <- as.matrix( TE001_subclustering@meta.data[c("UMAP_1_scanpy","UMAP_2_scanpy")] )
colnames(TE001_subclustering@reductions$umap@cell.embeddings) <- c("UMAP_1", "UMAP_2")
pdf(file.path(figures_path,"step_2_clustering_umap_pa.pdf"), width = 12, height = 6)
DimPlot(TE001_subclustering, group.by=c("seurat_clusters", "iter_cluster_id_with_paneth"),
reduction="umap", pt.size=1.5 )
dev.off()
quartz_off_screen
2
DimPlot(TE001_subclustering, group.by=c("seurat_clusters", "iter_cluster_id_with_paneth"),
reduction="umap", pt.size=1.5 )
Display cytotrace score on a UMAP.
pdf(file.path(figures_path,"step_2_clustering_umap_pa_cytotrace.pdf"), width = 6, height = 6)
FeaturePlot(TE001_subclustering, features = "cytotrace_te001", pt.size=1.5) & scale_color_viridis_c()
Scale for colour is already present.
Adding another scale for colour, which will replace the existing scale.
dev.off()
null device
1
FeaturePlot(TE001_subclustering, features = "cytotrace_te001", pt.size=1.5) & scale_color_viridis_c()
Scale for colour is already present.
Adding another scale for colour, which will replace the existing scale.
Perform differential gene expression analysis on the identified clusters after the solution optimized in 2 steps.
# Perform differential gene expression analysis
cat("Perform differential gene expression analysis on the identified clusters..\n")
Perform differential gene expression analysis on the identified clusters..
Idents(TE001_subclustering) <- "seurat_clusters"
# Use RNA slot for calculation of DE genes
TE001_subclustering <- NormalizeData(TE001_subclustering, assay="RNA", normalization.method = "LogNormalize")
Performing log-normalization
0% 10 20 30 40 50 60 70 80 90 100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
# FindAllMarkers
TE001_subclustering_markers <- FindAllMarkers(TE001_subclustering,
assay = "RNA",
slot="data",
test.use = "wilcox",
only.pos = TRUE,
min.pct = 0.25)
Calculating cluster 1_1
| | 0 % ~calculating
|+ | 1 % ~05s
|++ | 2 % ~05s
|++ | 3 % ~05s
|+++ | 4 % ~05s
|+++ | 6 % ~05s
|++++ | 7 % ~05s
|++++ | 8 % ~05s
|+++++ | 9 % ~05s
|+++++ | 10% ~05s
|++++++ | 11% ~05s
|+++++++ | 12% ~05s
|+++++++ | 13% ~05s
|++++++++ | 14% ~05s
|++++++++ | 16% ~04s
|+++++++++ | 17% ~04s
|+++++++++ | 18% ~04s
|++++++++++ | 19% ~04s
|++++++++++ | 20% ~04s
|+++++++++++ | 21% ~04s
|++++++++++++ | 22% ~04s
|++++++++++++ | 23% ~04s
|+++++++++++++ | 24% ~04s
|+++++++++++++ | 26% ~04s
|++++++++++++++ | 27% ~04s
|++++++++++++++ | 28% ~04s
|+++++++++++++++ | 29% ~04s
|+++++++++++++++ | 30% ~04s
|++++++++++++++++ | 31% ~04s
|+++++++++++++++++ | 32% ~04s
|+++++++++++++++++ | 33% ~04s
|++++++++++++++++++ | 34% ~03s
|++++++++++++++++++ | 36% ~03s
|+++++++++++++++++++ | 37% ~03s
|+++++++++++++++++++ | 38% ~03s
|++++++++++++++++++++ | 39% ~03s
|++++++++++++++++++++ | 40% ~03s
|+++++++++++++++++++++ | 41% ~03s
|++++++++++++++++++++++ | 42% ~03s
|++++++++++++++++++++++ | 43% ~03s
|+++++++++++++++++++++++ | 44% ~03s
|+++++++++++++++++++++++ | 46% ~03s
|++++++++++++++++++++++++ | 47% ~03s
|++++++++++++++++++++++++ | 48% ~03s
|+++++++++++++++++++++++++ | 49% ~03s
|+++++++++++++++++++++++++ | 50% ~03s
|++++++++++++++++++++++++++ | 51% ~03s
|+++++++++++++++++++++++++++ | 52% ~03s
|+++++++++++++++++++++++++++ | 53% ~02s
|++++++++++++++++++++++++++++ | 54% ~02s
|++++++++++++++++++++++++++++ | 56% ~02s
|+++++++++++++++++++++++++++++ | 57% ~02s
|+++++++++++++++++++++++++++++ | 58% ~02s
|++++++++++++++++++++++++++++++ | 59% ~02s
|++++++++++++++++++++++++++++++ | 60% ~02s
|+++++++++++++++++++++++++++++++ | 61% ~02s
|++++++++++++++++++++++++++++++++ | 62% ~02s
|++++++++++++++++++++++++++++++++ | 63% ~02s
|+++++++++++++++++++++++++++++++++ | 64% ~02s
|+++++++++++++++++++++++++++++++++ | 66% ~02s
|++++++++++++++++++++++++++++++++++ | 67% ~02s
|++++++++++++++++++++++++++++++++++ | 68% ~02s
|+++++++++++++++++++++++++++++++++++ | 69% ~02s
|+++++++++++++++++++++++++++++++++++ | 70% ~02s
|++++++++++++++++++++++++++++++++++++ | 71% ~02s
|+++++++++++++++++++++++++++++++++++++ | 72% ~01s
|+++++++++++++++++++++++++++++++++++++ | 73% ~01s
|++++++++++++++++++++++++++++++++++++++ | 74% ~01s
|++++++++++++++++++++++++++++++++++++++ | 76% ~01s
|+++++++++++++++++++++++++++++++++++++++ | 77% ~01s
|+++++++++++++++++++++++++++++++++++++++ | 78% ~01s
|++++++++++++++++++++++++++++++++++++++++ | 79% ~01s
|++++++++++++++++++++++++++++++++++++++++ | 80% ~01s
|+++++++++++++++++++++++++++++++++++++++++ | 81% ~01s
|++++++++++++++++++++++++++++++++++++++++++ | 82% ~01s
|++++++++++++++++++++++++++++++++++++++++++ | 83% ~01s
|+++++++++++++++++++++++++++++++++++++++++++ | 84% ~01s
|+++++++++++++++++++++++++++++++++++++++++++ | 86% ~01s
|++++++++++++++++++++++++++++++++++++++++++++ | 87% ~01s
|++++++++++++++++++++++++++++++++++++++++++++ | 88% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++ | 89% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++ | 90% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++ | 91% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 92% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 93% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 94% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 96% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=05s
Calculating cluster 1_2
| | 0 % ~calculating
|+ | 1 % ~01s
|++ | 2 % ~01s
|++ | 3 % ~01s
|+++ | 4 % ~01s
|+++ | 6 % ~01s
|++++ | 7 % ~01s
|++++ | 8 % ~01s
|+++++ | 9 % ~01s
|+++++ | 10% ~01s
|++++++ | 11% ~01s
|+++++++ | 12% ~01s
|+++++++ | 13% ~01s
|++++++++ | 14% ~01s
|++++++++ | 16% ~01s
|+++++++++ | 17% ~01s
|+++++++++ | 18% ~01s
|++++++++++ | 19% ~01s
|++++++++++ | 20% ~01s
|+++++++++++ | 21% ~01s
|++++++++++++ | 22% ~01s
|++++++++++++ | 23% ~01s
|+++++++++++++ | 24% ~01s
|+++++++++++++ | 26% ~01s
|++++++++++++++ | 27% ~01s
|++++++++++++++ | 28% ~01s
|+++++++++++++++ | 29% ~01s
|+++++++++++++++ | 30% ~01s
|++++++++++++++++ | 31% ~01s
|+++++++++++++++++ | 32% ~01s
|+++++++++++++++++ | 33% ~01s
|++++++++++++++++++ | 34% ~01s
|++++++++++++++++++ | 36% ~01s
|+++++++++++++++++++ | 37% ~01s
|+++++++++++++++++++ | 38% ~01s
|++++++++++++++++++++ | 39% ~01s
|++++++++++++++++++++ | 40% ~01s
|+++++++++++++++++++++ | 41% ~01s
|++++++++++++++++++++++ | 42% ~01s
|++++++++++++++++++++++ | 43% ~01s
|+++++++++++++++++++++++ | 44% ~01s
|+++++++++++++++++++++++ | 46% ~01s
|++++++++++++++++++++++++ | 47% ~01s
|++++++++++++++++++++++++ | 48% ~01s
|+++++++++++++++++++++++++ | 49% ~01s
|+++++++++++++++++++++++++ | 50% ~01s
|++++++++++++++++++++++++++ | 51% ~01s
|+++++++++++++++++++++++++++ | 52% ~01s
|+++++++++++++++++++++++++++ | 53% ~01s
|++++++++++++++++++++++++++++ | 54% ~01s
|++++++++++++++++++++++++++++ | 56% ~01s
|+++++++++++++++++++++++++++++ | 57% ~01s
|+++++++++++++++++++++++++++++ | 58% ~01s
|++++++++++++++++++++++++++++++ | 59% ~01s
|++++++++++++++++++++++++++++++ | 60% ~00s
|+++++++++++++++++++++++++++++++ | 61% ~00s
|++++++++++++++++++++++++++++++++ | 62% ~00s
|++++++++++++++++++++++++++++++++ | 63% ~00s
|+++++++++++++++++++++++++++++++++ | 64% ~00s
|+++++++++++++++++++++++++++++++++ | 66% ~00s
|++++++++++++++++++++++++++++++++++ | 67% ~00s
|++++++++++++++++++++++++++++++++++ | 68% ~00s
|+++++++++++++++++++++++++++++++++++ | 69% ~00s
|+++++++++++++++++++++++++++++++++++ | 70% ~00s
|++++++++++++++++++++++++++++++++++++ | 71% ~00s
|+++++++++++++++++++++++++++++++++++++ | 72% ~00s
|+++++++++++++++++++++++++++++++++++++ | 73% ~00s
|++++++++++++++++++++++++++++++++++++++ | 74% ~00s
|++++++++++++++++++++++++++++++++++++++ | 76% ~00s
|+++++++++++++++++++++++++++++++++++++++ | 77% ~00s
|+++++++++++++++++++++++++++++++++++++++ | 78% ~00s
|++++++++++++++++++++++++++++++++++++++++ | 79% ~00s
|++++++++++++++++++++++++++++++++++++++++ | 80% ~00s
|+++++++++++++++++++++++++++++++++++++++++ | 81% ~00s
|++++++++++++++++++++++++++++++++++++++++++ | 82% ~00s
|++++++++++++++++++++++++++++++++++++++++++ | 83% ~00s
|+++++++++++++++++++++++++++++++++++++++++++ | 84% ~00s
|+++++++++++++++++++++++++++++++++++++++++++ | 86% ~00s
|++++++++++++++++++++++++++++++++++++++++++++ | 87% ~00s
|++++++++++++++++++++++++++++++++++++++++++++ | 88% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++ | 89% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++ | 90% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++ | 91% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 92% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 93% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 94% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 96% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=01s
Calculating cluster 1_3
| | 0 % ~calculating
|+ | 1 % ~11s
|++ | 2 % ~11s
|++ | 3 % ~10s
|+++ | 4 % ~10s
|+++ | 5 % ~10s
|++++ | 6 % ~10s
|++++ | 7 % ~10s
|+++++ | 8 % ~10s
|+++++ | 9 % ~10s
|++++++ | 10% ~10s
|++++++ | 11% ~09s
|+++++++ | 12% ~09s
|+++++++ | 14% ~09s
|++++++++ | 15% ~09s
|++++++++ | 16% ~09s
|+++++++++ | 17% ~09s
|+++++++++ | 18% ~09s
|++++++++++ | 19% ~09s
|++++++++++ | 20% ~09s
|+++++++++++ | 21% ~08s
|+++++++++++ | 22% ~08s
|++++++++++++ | 23% ~08s
|++++++++++++ | 24% ~08s
|+++++++++++++ | 25% ~08s
|++++++++++++++ | 26% ~08s
|++++++++++++++ | 27% ~08s
|+++++++++++++++ | 28% ~08s
|+++++++++++++++ | 29% ~08s
|++++++++++++++++ | 30% ~07s
|++++++++++++++++ | 31% ~07s
|+++++++++++++++++ | 32% ~07s
|+++++++++++++++++ | 33% ~07s
|++++++++++++++++++ | 34% ~07s
|++++++++++++++++++ | 35% ~07s
|+++++++++++++++++++ | 36% ~07s
|+++++++++++++++++++ | 38% ~07s
|++++++++++++++++++++ | 39% ~07s
|++++++++++++++++++++ | 40% ~06s
|+++++++++++++++++++++ | 41% ~06s
|+++++++++++++++++++++ | 42% ~06s
|++++++++++++++++++++++ | 43% ~06s
|++++++++++++++++++++++ | 44% ~06s
|+++++++++++++++++++++++ | 45% ~06s
|+++++++++++++++++++++++ | 46% ~06s
|++++++++++++++++++++++++ | 47% ~06s
|++++++++++++++++++++++++ | 48% ~06s
|+++++++++++++++++++++++++ | 49% ~05s
|+++++++++++++++++++++++++ | 50% ~05s
|++++++++++++++++++++++++++ | 51% ~05s
|+++++++++++++++++++++++++++ | 52% ~05s
|+++++++++++++++++++++++++++ | 53% ~05s
|++++++++++++++++++++++++++++ | 54% ~05s
|++++++++++++++++++++++++++++ | 55% ~05s
|+++++++++++++++++++++++++++++ | 56% ~05s
|+++++++++++++++++++++++++++++ | 57% ~05s
|++++++++++++++++++++++++++++++ | 58% ~04s
|++++++++++++++++++++++++++++++ | 59% ~04s
|+++++++++++++++++++++++++++++++ | 60% ~04s
|+++++++++++++++++++++++++++++++ | 61% ~04s
|++++++++++++++++++++++++++++++++ | 62% ~04s
|++++++++++++++++++++++++++++++++ | 64% ~04s
|+++++++++++++++++++++++++++++++++ | 65% ~04s
|+++++++++++++++++++++++++++++++++ | 66% ~04s
|++++++++++++++++++++++++++++++++++ | 67% ~04s
|++++++++++++++++++++++++++++++++++ | 68% ~03s
|+++++++++++++++++++++++++++++++++++ | 69% ~03s
|+++++++++++++++++++++++++++++++++++ | 70% ~03s
|++++++++++++++++++++++++++++++++++++ | 71% ~03s
|++++++++++++++++++++++++++++++++++++ | 72% ~03s
|+++++++++++++++++++++++++++++++++++++ | 73% ~03s
|+++++++++++++++++++++++++++++++++++++ | 74% ~03s
|++++++++++++++++++++++++++++++++++++++ | 75% ~03s
|+++++++++++++++++++++++++++++++++++++++ | 76% ~03s
|+++++++++++++++++++++++++++++++++++++++ | 77% ~02s
|++++++++++++++++++++++++++++++++++++++++ | 78% ~02s
|++++++++++++++++++++++++++++++++++++++++ | 79% ~02s
|+++++++++++++++++++++++++++++++++++++++++ | 80% ~02s
|+++++++++++++++++++++++++++++++++++++++++ | 81% ~02s
|++++++++++++++++++++++++++++++++++++++++++ | 82% ~02s
|++++++++++++++++++++++++++++++++++++++++++ | 83% ~02s
|+++++++++++++++++++++++++++++++++++++++++++ | 84% ~02s
|+++++++++++++++++++++++++++++++++++++++++++ | 85% ~02s
|++++++++++++++++++++++++++++++++++++++++++++ | 86% ~01s
|++++++++++++++++++++++++++++++++++++++++++++ | 88% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++ | 89% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++ | 90% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++ | 91% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++ | 92% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 93% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 94% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 95% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 96% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=11s
Calculating cluster 2_1
| | 0 % ~calculating
|+ | 1 % ~05s
|++ | 2 % ~05s
|++ | 3 % ~05s
|+++ | 4 % ~05s
|+++ | 5 % ~05s
|++++ | 6 % ~05s
|++++ | 7 % ~05s
|+++++ | 8 % ~05s
|+++++ | 9 % ~04s
|++++++ | 10% ~04s
|++++++ | 11% ~04s
|+++++++ | 12% ~04s
|+++++++ | 13% ~04s
|++++++++ | 14% ~04s
|++++++++ | 15% ~04s
|+++++++++ | 16% ~04s
|+++++++++ | 17% ~04s
|++++++++++ | 18% ~04s
|++++++++++ | 19% ~04s
|+++++++++++ | 20% ~04s
|+++++++++++ | 21% ~04s
|++++++++++++ | 22% ~04s
|++++++++++++ | 23% ~04s
|+++++++++++++ | 24% ~04s
|+++++++++++++ | 26% ~04s
|++++++++++++++ | 27% ~04s
|++++++++++++++ | 28% ~04s
|+++++++++++++++ | 29% ~04s
|+++++++++++++++ | 30% ~03s
|++++++++++++++++ | 31% ~03s
|++++++++++++++++ | 32% ~03s
|+++++++++++++++++ | 33% ~03s
|+++++++++++++++++ | 34% ~03s
|++++++++++++++++++ | 35% ~03s
|++++++++++++++++++ | 36% ~03s
|+++++++++++++++++++ | 37% ~03s
|+++++++++++++++++++ | 38% ~03s
|++++++++++++++++++++ | 39% ~03s
|++++++++++++++++++++ | 40% ~03s
|+++++++++++++++++++++ | 41% ~03s
|+++++++++++++++++++++ | 42% ~03s
|++++++++++++++++++++++ | 43% ~03s
|++++++++++++++++++++++ | 44% ~03s
|+++++++++++++++++++++++ | 45% ~03s
|+++++++++++++++++++++++ | 46% ~03s
|++++++++++++++++++++++++ | 47% ~03s
|++++++++++++++++++++++++ | 48% ~03s
|+++++++++++++++++++++++++ | 49% ~03s
|+++++++++++++++++++++++++ | 50% ~02s
|++++++++++++++++++++++++++ | 51% ~02s
|+++++++++++++++++++++++++++ | 52% ~02s
|+++++++++++++++++++++++++++ | 53% ~02s
|++++++++++++++++++++++++++++ | 54% ~02s
|++++++++++++++++++++++++++++ | 55% ~02s
|+++++++++++++++++++++++++++++ | 56% ~02s
|+++++++++++++++++++++++++++++ | 57% ~02s
|++++++++++++++++++++++++++++++ | 58% ~02s
|++++++++++++++++++++++++++++++ | 59% ~02s
|+++++++++++++++++++++++++++++++ | 60% ~02s
|+++++++++++++++++++++++++++++++ | 61% ~02s
|++++++++++++++++++++++++++++++++ | 62% ~02s
|++++++++++++++++++++++++++++++++ | 63% ~02s
|+++++++++++++++++++++++++++++++++ | 64% ~02s
|+++++++++++++++++++++++++++++++++ | 65% ~02s
|++++++++++++++++++++++++++++++++++ | 66% ~02s
|++++++++++++++++++++++++++++++++++ | 67% ~02s
|+++++++++++++++++++++++++++++++++++ | 68% ~02s
|+++++++++++++++++++++++++++++++++++ | 69% ~02s
|++++++++++++++++++++++++++++++++++++ | 70% ~01s
|++++++++++++++++++++++++++++++++++++ | 71% ~01s
|+++++++++++++++++++++++++++++++++++++ | 72% ~01s
|+++++++++++++++++++++++++++++++++++++ | 73% ~01s
|++++++++++++++++++++++++++++++++++++++ | 74% ~01s
|++++++++++++++++++++++++++++++++++++++ | 76% ~01s
|+++++++++++++++++++++++++++++++++++++++ | 77% ~01s
|+++++++++++++++++++++++++++++++++++++++ | 78% ~01s
|++++++++++++++++++++++++++++++++++++++++ | 79% ~01s
|++++++++++++++++++++++++++++++++++++++++ | 80% ~01s
|+++++++++++++++++++++++++++++++++++++++++ | 81% ~01s
|+++++++++++++++++++++++++++++++++++++++++ | 82% ~01s
|++++++++++++++++++++++++++++++++++++++++++ | 83% ~01s
|++++++++++++++++++++++++++++++++++++++++++ | 84% ~01s
|+++++++++++++++++++++++++++++++++++++++++++ | 85% ~01s
|+++++++++++++++++++++++++++++++++++++++++++ | 86% ~01s
|++++++++++++++++++++++++++++++++++++++++++++ | 87% ~01s
|++++++++++++++++++++++++++++++++++++++++++++ | 88% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++ | 89% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++ | 90% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++ | 91% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++ | 92% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 93% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 94% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 95% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 96% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=05s
Calculating cluster 2_2
| | 0 % ~calculating
|+ | 1 % ~08s
|++ | 2 % ~08s
|++ | 3 % ~07s
|+++ | 4 % ~07s
|+++ | 5 % ~07s
|++++ | 6 % ~07s
|++++ | 8 % ~07s
|+++++ | 9 % ~07s
|+++++ | 10% ~07s
|++++++ | 11% ~07s
|++++++ | 12% ~07s
|+++++++ | 13% ~07s
|+++++++ | 14% ~07s
|++++++++ | 15% ~06s
|+++++++++ | 16% ~06s
|+++++++++ | 17% ~06s
|++++++++++ | 18% ~06s
|++++++++++ | 19% ~06s
|+++++++++++ | 20% ~06s
|+++++++++++ | 22% ~06s
|++++++++++++ | 23% ~06s
|++++++++++++ | 24% ~06s
|+++++++++++++ | 25% ~06s
|+++++++++++++ | 26% ~06s
|++++++++++++++ | 27% ~06s
|++++++++++++++ | 28% ~06s
|+++++++++++++++ | 29% ~05s
|++++++++++++++++ | 30% ~05s
|++++++++++++++++ | 31% ~05s
|+++++++++++++++++ | 32% ~05s
|+++++++++++++++++ | 33% ~05s
|++++++++++++++++++ | 34% ~05s
|++++++++++++++++++ | 35% ~05s
|+++++++++++++++++++ | 37% ~05s
|+++++++++++++++++++ | 38% ~05s
|++++++++++++++++++++ | 39% ~05s
|++++++++++++++++++++ | 40% ~05s
|+++++++++++++++++++++ | 41% ~05s
|+++++++++++++++++++++ | 42% ~04s
|++++++++++++++++++++++ | 43% ~04s
|+++++++++++++++++++++++ | 44% ~04s
|+++++++++++++++++++++++ | 45% ~04s
|++++++++++++++++++++++++ | 46% ~04s
|++++++++++++++++++++++++ | 47% ~04s
|+++++++++++++++++++++++++ | 48% ~04s
|+++++++++++++++++++++++++ | 49% ~04s
|++++++++++++++++++++++++++ | 51% ~04s
|++++++++++++++++++++++++++ | 52% ~04s
|+++++++++++++++++++++++++++ | 53% ~04s
|+++++++++++++++++++++++++++ | 54% ~04s
|++++++++++++++++++++++++++++ | 55% ~03s
|++++++++++++++++++++++++++++ | 56% ~03s
|+++++++++++++++++++++++++++++ | 57% ~03s
|++++++++++++++++++++++++++++++ | 58% ~03s
|++++++++++++++++++++++++++++++ | 59% ~03s
|+++++++++++++++++++++++++++++++ | 60% ~03s
|+++++++++++++++++++++++++++++++ | 61% ~03s
|++++++++++++++++++++++++++++++++ | 62% ~03s
|++++++++++++++++++++++++++++++++ | 63% ~03s
|+++++++++++++++++++++++++++++++++ | 65% ~03s
|+++++++++++++++++++++++++++++++++ | 66% ~03s
|++++++++++++++++++++++++++++++++++ | 67% ~03s
|++++++++++++++++++++++++++++++++++ | 68% ~02s
|+++++++++++++++++++++++++++++++++++ | 69% ~02s
|+++++++++++++++++++++++++++++++++++ | 70% ~02s
|++++++++++++++++++++++++++++++++++++ | 71% ~02s
|+++++++++++++++++++++++++++++++++++++ | 72% ~02s
|+++++++++++++++++++++++++++++++++++++ | 73% ~02s
|++++++++++++++++++++++++++++++++++++++ | 74% ~02s
|++++++++++++++++++++++++++++++++++++++ | 75% ~02s
|+++++++++++++++++++++++++++++++++++++++ | 76% ~02s
|+++++++++++++++++++++++++++++++++++++++ | 77% ~02s
|++++++++++++++++++++++++++++++++++++++++ | 78% ~02s
|++++++++++++++++++++++++++++++++++++++++ | 80% ~02s
|+++++++++++++++++++++++++++++++++++++++++ | 81% ~01s
|+++++++++++++++++++++++++++++++++++++++++ | 82% ~01s
|++++++++++++++++++++++++++++++++++++++++++ | 83% ~01s
|++++++++++++++++++++++++++++++++++++++++++ | 84% ~01s
|+++++++++++++++++++++++++++++++++++++++++++ | 85% ~01s
|++++++++++++++++++++++++++++++++++++++++++++ | 86% ~01s
|++++++++++++++++++++++++++++++++++++++++++++ | 87% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++ | 88% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++ | 89% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++ | 90% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++ | 91% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 92% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 94% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 95% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 96% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=08s
Calculating cluster 3_1
| | 0 % ~calculating
|+ | 1 % ~03s
|++ | 2 % ~03s
|++ | 3 % ~03s
|+++ | 4 % ~03s
|+++ | 5 % ~03s
|++++ | 6 % ~03s
|++++ | 8 % ~03s
|+++++ | 9 % ~03s
|+++++ | 10% ~03s
|++++++ | 11% ~03s
|++++++ | 12% ~03s
|+++++++ | 13% ~03s
|+++++++ | 14% ~03s
|++++++++ | 15% ~03s
|+++++++++ | 16% ~03s
|+++++++++ | 17% ~03s
|++++++++++ | 18% ~02s
|++++++++++ | 19% ~02s
|+++++++++++ | 20% ~02s
|+++++++++++ | 22% ~02s
|++++++++++++ | 23% ~02s
|++++++++++++ | 24% ~02s
|+++++++++++++ | 25% ~02s
|+++++++++++++ | 26% ~02s
|++++++++++++++ | 27% ~02s
|++++++++++++++ | 28% ~02s
|+++++++++++++++ | 29% ~02s
|++++++++++++++++ | 30% ~02s
|++++++++++++++++ | 31% ~02s
|+++++++++++++++++ | 32% ~02s
|+++++++++++++++++ | 33% ~02s
|++++++++++++++++++ | 34% ~02s
|++++++++++++++++++ | 35% ~02s
|+++++++++++++++++++ | 37% ~02s
|+++++++++++++++++++ | 38% ~02s
|++++++++++++++++++++ | 39% ~02s
|++++++++++++++++++++ | 40% ~02s
|+++++++++++++++++++++ | 41% ~02s
|+++++++++++++++++++++ | 42% ~02s
|++++++++++++++++++++++ | 43% ~02s
|+++++++++++++++++++++++ | 44% ~02s
|+++++++++++++++++++++++ | 45% ~02s
|++++++++++++++++++++++++ | 46% ~02s
|++++++++++++++++++++++++ | 47% ~02s
|+++++++++++++++++++++++++ | 48% ~02s
|+++++++++++++++++++++++++ | 49% ~02s
|++++++++++++++++++++++++++ | 51% ~02s
|++++++++++++++++++++++++++ | 52% ~02s
|+++++++++++++++++++++++++++ | 53% ~01s
|+++++++++++++++++++++++++++ | 54% ~01s
|++++++++++++++++++++++++++++ | 55% ~01s
|++++++++++++++++++++++++++++ | 56% ~01s
|+++++++++++++++++++++++++++++ | 57% ~01s
|++++++++++++++++++++++++++++++ | 58% ~01s
|++++++++++++++++++++++++++++++ | 59% ~01s
|+++++++++++++++++++++++++++++++ | 60% ~01s
|+++++++++++++++++++++++++++++++ | 61% ~01s
|++++++++++++++++++++++++++++++++ | 62% ~01s
|++++++++++++++++++++++++++++++++ | 63% ~01s
|+++++++++++++++++++++++++++++++++ | 65% ~01s
|+++++++++++++++++++++++++++++++++ | 66% ~01s
|++++++++++++++++++++++++++++++++++ | 67% ~01s
|++++++++++++++++++++++++++++++++++ | 68% ~01s
|+++++++++++++++++++++++++++++++++++ | 69% ~01s
|+++++++++++++++++++++++++++++++++++ | 70% ~01s
|++++++++++++++++++++++++++++++++++++ | 71% ~01s
|+++++++++++++++++++++++++++++++++++++ | 72% ~01s
|+++++++++++++++++++++++++++++++++++++ | 73% ~01s
|++++++++++++++++++++++++++++++++++++++ | 74% ~01s
|++++++++++++++++++++++++++++++++++++++ | 75% ~01s
|+++++++++++++++++++++++++++++++++++++++ | 76% ~01s
|+++++++++++++++++++++++++++++++++++++++ | 77% ~01s
|++++++++++++++++++++++++++++++++++++++++ | 78% ~01s
|++++++++++++++++++++++++++++++++++++++++ | 80% ~01s
|+++++++++++++++++++++++++++++++++++++++++ | 81% ~01s
|+++++++++++++++++++++++++++++++++++++++++ | 82% ~01s
|++++++++++++++++++++++++++++++++++++++++++ | 83% ~01s
|++++++++++++++++++++++++++++++++++++++++++ | 84% ~01s
|+++++++++++++++++++++++++++++++++++++++++++ | 85% ~00s
|++++++++++++++++++++++++++++++++++++++++++++ | 86% ~00s
|++++++++++++++++++++++++++++++++++++++++++++ | 87% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++ | 88% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++ | 89% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++ | 90% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++ | 91% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 92% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 94% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 95% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 96% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=03s
Calculating cluster 3_2
| | 0 % ~calculating
|+ | 1 % ~18s
|++ | 2 % ~17s
|++ | 3 % ~17s
|+++ | 4 % ~17s
|+++ | 5 % ~17s
|++++ | 6 % ~17s
|++++ | 7 % ~17s
|+++++ | 8 % ~16s
|+++++ | 9 % ~16s
|++++++ | 10% ~16s
|++++++ | 11% ~16s
|+++++++ | 12% ~16s
|+++++++ | 13% ~15s
|++++++++ | 14% ~15s
|++++++++ | 15% ~15s
|+++++++++ | 16% ~15s
|+++++++++ | 17% ~15s
|++++++++++ | 18% ~15s
|++++++++++ | 19% ~14s
|+++++++++++ | 20% ~14s
|+++++++++++ | 21% ~14s
|++++++++++++ | 22% ~14s
|++++++++++++ | 23% ~14s
|+++++++++++++ | 24% ~13s
|+++++++++++++ | 26% ~13s
|++++++++++++++ | 27% ~13s
|++++++++++++++ | 28% ~13s
|+++++++++++++++ | 29% ~13s
|+++++++++++++++ | 30% ~13s
|++++++++++++++++ | 31% ~12s
|++++++++++++++++ | 32% ~12s
|+++++++++++++++++ | 33% ~12s
|+++++++++++++++++ | 34% ~12s
|++++++++++++++++++ | 35% ~12s
|++++++++++++++++++ | 36% ~12s
|+++++++++++++++++++ | 37% ~11s
|+++++++++++++++++++ | 38% ~11s
|++++++++++++++++++++ | 39% ~11s
|++++++++++++++++++++ | 40% ~11s
|+++++++++++++++++++++ | 41% ~11s
|+++++++++++++++++++++ | 42% ~10s
|++++++++++++++++++++++ | 43% ~10s
|++++++++++++++++++++++ | 44% ~10s
|+++++++++++++++++++++++ | 45% ~10s
|+++++++++++++++++++++++ | 46% ~10s
|++++++++++++++++++++++++ | 47% ~10s
|++++++++++++++++++++++++ | 48% ~09s
|+++++++++++++++++++++++++ | 49% ~09s
|+++++++++++++++++++++++++ | 50% ~09s
|++++++++++++++++++++++++++ | 51% ~09s
|+++++++++++++++++++++++++++ | 52% ~09s
|+++++++++++++++++++++++++++ | 53% ~08s
|++++++++++++++++++++++++++++ | 54% ~08s
|++++++++++++++++++++++++++++ | 55% ~08s
|+++++++++++++++++++++++++++++ | 56% ~08s
|+++++++++++++++++++++++++++++ | 57% ~08s
|++++++++++++++++++++++++++++++ | 58% ~08s
|++++++++++++++++++++++++++++++ | 59% ~07s
|+++++++++++++++++++++++++++++++ | 60% ~07s
|+++++++++++++++++++++++++++++++ | 61% ~07s
|++++++++++++++++++++++++++++++++ | 62% ~07s
|++++++++++++++++++++++++++++++++ | 63% ~07s
|+++++++++++++++++++++++++++++++++ | 64% ~06s
|+++++++++++++++++++++++++++++++++ | 65% ~06s
|++++++++++++++++++++++++++++++++++ | 66% ~06s
|++++++++++++++++++++++++++++++++++ | 67% ~06s
|+++++++++++++++++++++++++++++++++++ | 68% ~06s
|+++++++++++++++++++++++++++++++++++ | 69% ~06s
|++++++++++++++++++++++++++++++++++++ | 70% ~05s
|++++++++++++++++++++++++++++++++++++ | 71% ~05s
|+++++++++++++++++++++++++++++++++++++ | 72% ~05s
|+++++++++++++++++++++++++++++++++++++ | 73% ~05s
|++++++++++++++++++++++++++++++++++++++ | 74% ~05s
|++++++++++++++++++++++++++++++++++++++ | 76% ~04s
|+++++++++++++++++++++++++++++++++++++++ | 77% ~04s
|+++++++++++++++++++++++++++++++++++++++ | 78% ~04s
|++++++++++++++++++++++++++++++++++++++++ | 79% ~04s
|++++++++++++++++++++++++++++++++++++++++ | 80% ~04s
|+++++++++++++++++++++++++++++++++++++++++ | 81% ~03s
|+++++++++++++++++++++++++++++++++++++++++ | 82% ~03s
|++++++++++++++++++++++++++++++++++++++++++ | 83% ~03s
|++++++++++++++++++++++++++++++++++++++++++ | 84% ~03s
|+++++++++++++++++++++++++++++++++++++++++++ | 85% ~03s
|+++++++++++++++++++++++++++++++++++++++++++ | 86% ~03s
|++++++++++++++++++++++++++++++++++++++++++++ | 87% ~02s
|++++++++++++++++++++++++++++++++++++++++++++ | 88% ~02s
|+++++++++++++++++++++++++++++++++++++++++++++ | 89% ~02s
|+++++++++++++++++++++++++++++++++++++++++++++ | 90% ~02s
|++++++++++++++++++++++++++++++++++++++++++++++ | 91% ~02s
|++++++++++++++++++++++++++++++++++++++++++++++ | 92% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 93% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 94% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 95% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 96% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=18s
Calculating cluster 3_3
| | 0 % ~calculating
|+ | 1 % ~00s
|++ | 3 % ~00s
|+++ | 4 % ~00s
|+++ | 6 % ~00s
|++++ | 7 % ~00s
|+++++ | 9 % ~00s
|++++++ | 10% ~00s
|++++++ | 12% ~00s
|+++++++ | 13% ~00s
|++++++++ | 14% ~00s
|++++++++ | 16% ~00s
|+++++++++ | 17% ~00s
|++++++++++ | 19% ~00s
|+++++++++++ | 20% ~00s
|+++++++++++ | 22% ~00s
|++++++++++++ | 23% ~00s
|+++++++++++++ | 25% ~00s
|++++++++++++++ | 26% ~00s
|++++++++++++++ | 28% ~00s
|+++++++++++++++ | 29% ~00s
|++++++++++++++++ | 30% ~00s
|++++++++++++++++ | 32% ~00s
|+++++++++++++++++ | 33% ~00s
|++++++++++++++++++ | 35% ~00s
|+++++++++++++++++++ | 36% ~00s
|+++++++++++++++++++ | 38% ~00s
|++++++++++++++++++++ | 39% ~00s
|+++++++++++++++++++++ | 41% ~00s
|++++++++++++++++++++++ | 42% ~00s
|++++++++++++++++++++++ | 43% ~00s
|+++++++++++++++++++++++ | 45% ~00s
|++++++++++++++++++++++++ | 46% ~00s
|++++++++++++++++++++++++ | 48% ~00s
|+++++++++++++++++++++++++ | 49% ~00s
|++++++++++++++++++++++++++ | 51% ~00s
|+++++++++++++++++++++++++++ | 52% ~00s
|+++++++++++++++++++++++++++ | 54% ~00s
|++++++++++++++++++++++++++++ | 55% ~00s
|+++++++++++++++++++++++++++++ | 57% ~00s
|+++++++++++++++++++++++++++++ | 58% ~00s
|++++++++++++++++++++++++++++++ | 59% ~00s
|+++++++++++++++++++++++++++++++ | 61% ~00s
|++++++++++++++++++++++++++++++++ | 62% ~00s
|++++++++++++++++++++++++++++++++ | 64% ~00s
|+++++++++++++++++++++++++++++++++ | 65% ~00s
|++++++++++++++++++++++++++++++++++ | 67% ~00s
|+++++++++++++++++++++++++++++++++++ | 68% ~00s
|+++++++++++++++++++++++++++++++++++ | 70% ~00s
|++++++++++++++++++++++++++++++++++++ | 71% ~00s
|+++++++++++++++++++++++++++++++++++++ | 72% ~00s
|+++++++++++++++++++++++++++++++++++++ | 74% ~00s
|++++++++++++++++++++++++++++++++++++++ | 75% ~00s
|+++++++++++++++++++++++++++++++++++++++ | 77% ~00s
|++++++++++++++++++++++++++++++++++++++++ | 78% ~00s
|++++++++++++++++++++++++++++++++++++++++ | 80% ~00s
|+++++++++++++++++++++++++++++++++++++++++ | 81% ~00s
|++++++++++++++++++++++++++++++++++++++++++ | 83% ~00s
|+++++++++++++++++++++++++++++++++++++++++++ | 84% ~00s
|+++++++++++++++++++++++++++++++++++++++++++ | 86% ~00s
|++++++++++++++++++++++++++++++++++++++++++++ | 87% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++ | 88% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++ | 90% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++ | 91% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 93% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 94% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 96% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=00s
Calculating cluster 4
| | 0 % ~calculating
|+ | 1 % ~10s
|+ | 2 % ~10s
|++ | 3 % ~09s
|++ | 4 % ~09s
|+++ | 5 % ~09s
|+++ | 6 % ~09s
|++++ | 7 % ~09s
|++++ | 8 % ~09s
|+++++ | 9 % ~09s
|+++++ | 10% ~09s
|++++++ | 11% ~09s
|++++++ | 12% ~08s
|+++++++ | 13% ~08s
|+++++++ | 14% ~08s
|++++++++ | 15% ~08s
|++++++++ | 16% ~08s
|+++++++++ | 17% ~08s
|+++++++++ | 18% ~08s
|++++++++++ | 19% ~08s
|++++++++++ | 20% ~08s
|+++++++++++ | 21% ~08s
|+++++++++++ | 22% ~08s
|++++++++++++ | 23% ~07s
|++++++++++++ | 24% ~07s
|+++++++++++++ | 25% ~07s
|+++++++++++++ | 26% ~07s
|++++++++++++++ | 27% ~07s
|++++++++++++++ | 28% ~07s
|+++++++++++++++ | 29% ~07s
|+++++++++++++++ | 30% ~07s
|++++++++++++++++ | 31% ~07s
|++++++++++++++++ | 32% ~07s
|+++++++++++++++++ | 33% ~07s
|+++++++++++++++++ | 34% ~06s
|++++++++++++++++++ | 35% ~06s
|++++++++++++++++++ | 36% ~06s
|+++++++++++++++++++ | 37% ~06s
|+++++++++++++++++++ | 38% ~06s
|++++++++++++++++++++ | 39% ~06s
|++++++++++++++++++++ | 40% ~06s
|+++++++++++++++++++++ | 41% ~06s
|+++++++++++++++++++++ | 42% ~06s
|++++++++++++++++++++++ | 43% ~06s
|++++++++++++++++++++++ | 44% ~06s
|+++++++++++++++++++++++ | 45% ~05s
|+++++++++++++++++++++++ | 46% ~05s
|++++++++++++++++++++++++ | 47% ~05s
|++++++++++++++++++++++++ | 48% ~05s
|+++++++++++++++++++++++++ | 49% ~05s
|+++++++++++++++++++++++++ | 50% ~05s
|++++++++++++++++++++++++++ | 51% ~05s
|++++++++++++++++++++++++++ | 52% ~05s
|+++++++++++++++++++++++++++ | 53% ~05s
|+++++++++++++++++++++++++++ | 54% ~05s
|++++++++++++++++++++++++++++ | 55% ~04s
|++++++++++++++++++++++++++++ | 56% ~04s
|+++++++++++++++++++++++++++++ | 57% ~04s
|+++++++++++++++++++++++++++++ | 58% ~04s
|++++++++++++++++++++++++++++++ | 59% ~04s
|++++++++++++++++++++++++++++++ | 60% ~04s
|+++++++++++++++++++++++++++++++ | 61% ~04s
|+++++++++++++++++++++++++++++++ | 62% ~04s
|++++++++++++++++++++++++++++++++ | 63% ~04s
|++++++++++++++++++++++++++++++++ | 64% ~04s
|+++++++++++++++++++++++++++++++++ | 65% ~03s
|+++++++++++++++++++++++++++++++++ | 66% ~03s
|++++++++++++++++++++++++++++++++++ | 67% ~03s
|++++++++++++++++++++++++++++++++++ | 68% ~03s
|+++++++++++++++++++++++++++++++++++ | 69% ~03s
|+++++++++++++++++++++++++++++++++++ | 70% ~03s
|++++++++++++++++++++++++++++++++++++ | 71% ~03s
|++++++++++++++++++++++++++++++++++++ | 72% ~03s
|+++++++++++++++++++++++++++++++++++++ | 73% ~03s
|+++++++++++++++++++++++++++++++++++++ | 74% ~03s
|++++++++++++++++++++++++++++++++++++++ | 75% ~02s
|++++++++++++++++++++++++++++++++++++++ | 76% ~02s
|+++++++++++++++++++++++++++++++++++++++ | 77% ~02s
|+++++++++++++++++++++++++++++++++++++++ | 78% ~02s
|++++++++++++++++++++++++++++++++++++++++ | 79% ~02s
|++++++++++++++++++++++++++++++++++++++++ | 80% ~02s
|+++++++++++++++++++++++++++++++++++++++++ | 81% ~02s
|+++++++++++++++++++++++++++++++++++++++++ | 82% ~02s
|++++++++++++++++++++++++++++++++++++++++++ | 83% ~02s
|++++++++++++++++++++++++++++++++++++++++++ | 84% ~02s
|+++++++++++++++++++++++++++++++++++++++++++ | 85% ~01s
|+++++++++++++++++++++++++++++++++++++++++++ | 86% ~01s
|++++++++++++++++++++++++++++++++++++++++++++ | 87% ~01s
|++++++++++++++++++++++++++++++++++++++++++++ | 88% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++ | 89% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++ | 90% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++ | 91% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++ | 92% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 93% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 94% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 95% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 96% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=10s
top10 <- TE001_subclustering_markers %>% group_by(cluster) %>% top_n(n = 10, wt = avg_log2FC)
Generate a heatmap showing the top 10 differentially expressed genes on a per-cluster basis
genes <- top10$gene
mat_to_show <- as.matrix(TE001_subclustering@assays$SCT@scale.data[genes,])
Clusters <- TE001_subclustering$seurat_clusters
colors <- rainbow(nlevels(Clusters))
names(colors) <- levels(Clusters)
# prepare df_annot.df
per.cell.sil.width <- s[,"sil_width"]
names(per.cell.sil.width) <- colnames(TE001_subclustering)
df_annot.df <- TE001_subclustering@meta.data %>%
dplyr::select(cluster_id=seurat_clusters, cytotrace_score = cytotrace_te001) %>%
tibble::rownames_to_column(.,var="cell_id")
df_annot.df$cluster_id <- factor(as.numeric(df_annot.df$cluster_id))
x <- as.data.frame(per.cell.sil.width) %>%
tibble::rownames_to_column(.,var="sample_id")
df_annot.df <- left_join(df_annot.df,x,by=c("cell_id"="sample_id"))
df_annot.df <- merge(df_annot.df, TE001_subclustering@meta.data[, c("cell_id", "seurat_clusters")], by = "cell_id", all.x = TRUE) # rename clusters as a tree-like structure
df_annot.df <- df_annot.df[,-2] %>% dplyr::rename(cluster_id=seurat_clusters)
sample_ordering_to_print <- rev( order( df_annot.df$per.cell.sil.width ) )
df_annot.df <- df_annot.df[sample_ordering_to_print,]
mat_to_show <- mat_to_show[,match(df_annot.df$cell_id,colnames(mat_to_show))]
stopifnot(identical( df_annot.df$cell_id, colnames(mat_to_show) ))
# the silhouette score
sil.fill <- rep(NA, nrow(df_annot.df))
unique_clusters <- unique(df_annot.df$cluster_id)
n_colors <- length(colors)
color_index <- 1
for (i in seq_along(unique_clusters)) {
cluster <- unique_clusters[i]
sil.fill[df_annot.df$cluster_id == cluster] <- colors[names(colors) == cluster]
color_index <- i + 1 # Use modulo to cycle through colors
}
df_annot_cols_cluster_score <- HeatmapAnnotation(
silhouette_score = anno_barplot(
df_annot.df$per.cell.sil.width,
bar_width = 1,
gp = gpar(col = NA,
fontsize = 6 ,
cex = 0.8 ,
fill = sil.fill
),
border = FALSE,
height = unit(1.25, "cm") ,
width = unit(0.5, "cm")
)
)
# heatmap annotation
df_annot.df <- df_annot.df %>% dplyr::select(cluster_id)
cluster_colors <- colors[ !is.na(names(colors)) ]
df_annot_cols = HeatmapAnnotation( df = df_annot.df,
col = list(cluster_id=cluster_colors) ,
show_legend = TRUE , na_col = "gray95",
annotation_name_gp = gpar(fontsize=0.1)
)
top10_hm <- Heatmap( mat_to_show,
col = circlize::colorRamp2(range(mat_to_show_default)/2, c("darkslateblue", "yellow")),
use_raster = FALSE ,
column_split = df_annot.df$cluster_id,
heatmap_legend_param = list(color_bar = "continuous") ,
cluster_columns = FALSE ,
cluster_rows = FALSE ,
show_column_names = FALSE ,
name = "Gene Expression (log1p)" ,
row_names_gp = gpar(fontsize = 10) , column_names_gp = gpar(fontsize = 8),
row_title_side = "left" , row_title_gp = gpar(fontsize = 10, fontface = "bold")
)
ht_list = df_annot_cols_cluster_score %v% df_annot_cols %v% top10_hm
pdf(file.path(figures_path,"top_10_heatmap.pdf"), width = 10, height = 12)
p <- draw(ht_list, column_km = 1 ,
heatmap_legend_side = "right",
annotation_legend_side = "bottom" )
dev.off()
null device
1
p
Display a dotplot with the top 5 genes per cluster (using the
data slot).
# DotPlot
top5 <- TE001_subclustering_markers %>% group_by(cluster) %>% top_n(n = 5, wt = avg_log2FC)
genes_dp <- top5$gene %>% unique()
# intialize lists containing dataframes
Avgs <- vector( mode="list", length=length(levels(TE001_subclustering$seurat_clusters)) )
names(Avgs) <- levels(TE001_subclustering$seurat_clusters)
Pct <- vector( mode="list", length=length(levels(TE001_subclustering$seurat_clusters)) )
names(Pct) <- levels(TE001_subclustering$seurat_clusters)
for (cluster in levels(TE001_subclustering$seurat_clusters)){
cells_in_subcluster <- TE001_subclustering$seurat_clusters == cluster
# Avg
Avgs[[cluster]] <- TE001_subclustering[["RNA"]]@data[genes_dp, cells_in_subcluster] %>%
rowMeans() %>%
as.data.frame() %>%
rownames_to_column() %>%
dplyr::rename(.,"Gene"=rowname,"mean"=.) %>%
dplyr::mutate(cluster=cluster)
# Pct
Pct[[cluster]] <- TE001_subclustering[["RNA"]]@data[genes_dp, cells_in_subcluster] %>%
apply(.,1, function(x){ sum(x>0)/length(x)*100 }) %>%
as.data.frame() %>%
rownames_to_column() %>%
dplyr::rename(.,"Gene"=rowname,"Pct"=.) %>%
dplyr::mutate(cluster=cluster)
}
# Mean
df_mean.GEx <- do.call(rbind, Avgs)
rownames(df_mean.GEx) <- NULL
# Pct
df_pct.GEx <- do.call(rbind, Pct)
rownames(df_pct.GEx) <- NULL
# Summary
summary.GEx <- cbind(df_mean.GEx[,1:2],df_pct.GEx[,2:3])
summary.GEx$Gene <- factor(summary.GEx$Gene, levels=genes_dp, ordered = TRUE)
# Printing dotplot for genes
cat("Printing dotplots..\n")
Printing dotplots..
GEx.DGE_DotPlot <- ggplot(summary.GEx, aes(x=Gene,y=cluster)) +
geom_point(aes(size = Pct, fill= mean), color="black", shape=21) +
scale_size("% detected", range = c(0,15), breaks=c(0,25,50,75,100), limits=c(0,100)) +
scale_fill_gradient2(low="steelblue1", high = "red", mid="white",midpoint=0,
limits=range(summary.GEx$mean),
guide = guide_colorbar(ticks.colour = "black",
frame.colour = "black"),
name = "Average Expression\nlog1p(counts)") +
ylab("Cluster") + xlab("") +
theme_bw() +
theme(axis.text.x = element_text(size=10, angle=45, hjust=1, color="black"),
axis.text.y = element_text(size=12, color="black"),
axis.title = element_text(size=14) ,
panel.grid.major = element_blank(), panel.grid.minor = element_blank()
)
pdf(file.path(figures_path, "GEx-DGE-dotplot.pdf") , width = 22 , height = 9)
print(GEx.DGE_DotPlot)
dev.off()
null device
1
print(GEx.DGE_DotPlot)
Save Seurat Object with clustering solution as an .rds
file to the DataFolder location.
saveRDS(object=TE001_subclustering, file=file.path(savingsFolder, "TE001_iter_subclustering_gene_expr.rds"))
sessionInfo()
R version 4.3.0 (2023-04-21)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS 14.0
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib; LAPACK version 3.11.0
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
time zone: America/New_York
tzcode source: internal
attached base packages:
[1] grid stats4 stats graphics grDevices utils datasets methods base
other attached packages:
[1] GenSA_1.1.8 SeuratDisk_0.0.0.9021 pbmc3k.SeuratData_3.1.4 SeuratData_0.2.2 gridExtra_2.3 circlize_0.4.15
[7] RColorBrewer_1.1-3 ComplexHeatmap_2.16.0 factoextra_1.0.7 cluster_2.1.6 acdc_0.1.0 tibble_3.2.1
[13] SeuratObject_4.1.3 Seurat_4.3.0.1 matrixStats_1.0.0 metap_1.8 openxlsx_4.2.5.2 org.Hs.eg.db_3.17.0
[19] AnnotationDbi_1.62.1 IRanges_2.34.1 S4Vectors_0.38.1 Biobase_2.60.0 BiocGenerics_0.46.0 RobustRankAggreg_1.2.1
[25] MOMA_1.12.0 ggplot2_3.4.2 dplyr_1.1.2
loaded via a namespace (and not attached):
[1] R.methodsS3_1.8.2 goftest_1.2-3 Biostrings_2.68.1 TH.data_1.1-2 vctrs_0.6.3
[6] spatstat.random_3.1-5 digest_0.6.31 png_0.1-8 shape_1.4.6 ggrepel_0.9.3
[11] deldir_1.0-9 parallelly_1.36.0 MASS_7.3-60 reshape2_1.4.4 httpuv_1.6.11
[16] foreach_1.5.2 qvalue_2.32.0 withr_2.5.0 ggrastr_1.0.2 xfun_0.39
[21] ggpubr_0.6.0 ellipsis_0.3.2 survival_3.5-5 memoise_2.0.1 ggbeeswarm_0.7.2
[26] zoo_1.8-12 GlobalOptions_0.1.2 pbapply_1.7-2 R.oo_1.25.0 DEoptimR_1.0-14
[31] KEGGREST_1.40.0 promises_1.2.0.1 httr_1.4.6 rstatix_0.7.2 globals_0.16.2
[36] fitdistrplus_1.1-11 rstudioapi_0.14 miniUI_0.1.1.1 generics_0.1.3 zlibbioc_1.46.0
[41] polyclip_1.10-4 TFisher_0.2.0 GenomeInfoDbData_1.2.10 xtable_1.8-4 stringr_1.5.0
[46] doParallel_1.0.17 evaluate_0.21 S4Arrays_1.0.4 MKmisc_1.9 hms_1.1.3
[51] GenomicRanges_1.52.0 irlba_2.3.5.1 colorspace_2.1-0 hdf5r_1.3.8 ROCR_1.0-11
[56] reticulate_1.30 readxl_1.4.2 spatstat.data_3.0-1 magrittr_2.0.3 lmtest_0.9-40
[61] readr_2.1.4 later_1.3.1 viridis_0.6.3 lattice_0.21-8 spatstat.geom_3.2-1
[66] future.apply_1.11.0 robustbase_0.99-0 scattermore_1.2 cowplot_1.1.1 RcppAnnoy_0.0.21
[71] pillar_1.9.0 nlme_3.1-162 iterators_1.0.14 compiler_4.3.0 stringi_1.7.12
[76] tensor_1.5 SummarizedExperiment_1.30.2 plyr_1.8.8 crayon_1.5.2 abind_1.4-5
[81] sn_2.1.1 sp_2.0-0 bit_4.0.5 mathjaxr_1.6-0 sandwich_3.0-2
[86] codetools_0.2-19 multcomp_1.4-25 bslib_0.5.0 GetoptLong_1.0.5 plotly_4.10.2
[91] multtest_2.56.0 mime_0.12 MultiAssayExperiment_1.26.0 splines_4.3.0 Rcpp_1.0.10
[96] cellranger_1.1.0 knitr_1.43 blob_1.2.4 utf8_1.2.3 clue_0.3-64
[101] listenv_0.9.0 Rdpack_2.4 ggsignif_0.6.4 Matrix_1.5-4.1 tzdb_0.4.0
[106] pkgconfig_2.0.3 tools_4.3.0 cachem_1.0.8 rbibutils_2.2.13 RSQLite_2.3.1
[111] viridisLite_0.4.2 DBI_1.1.3 numDeriv_2016.8-1.1 fastmap_1.1.1 rmarkdown_2.23
[116] scales_1.2.1 ica_1.0-3 broom_1.0.5 sass_0.4.6 patchwork_1.1.2
[121] carData_3.0-5 RANN_2.6.1 farver_2.1.1 yaml_2.3.7 MatrixGenerics_1.12.2
[126] cli_3.6.1 purrr_1.0.1 leiden_0.4.3 lifecycle_1.0.3 rsconnect_1.2.0
[131] uwot_0.1.16 mvtnorm_1.2-2 backports_1.4.1 gtable_0.3.3 rjson_0.2.21
[136] ggridges_0.5.4 progressr_0.13.0 parallel_4.3.0 limma_3.56.2 jsonlite_1.8.7
[141] bitops_1.0-7 bit64_4.0.5 qqconf_1.3.2 Rtsne_0.16 spatstat.utils_3.0-3
[146] zip_2.3.0 mutoss_0.1-13 jquerylib_0.1.4 R.utils_2.12.2 lazyeval_0.2.2
[151] shiny_1.7.4 htmltools_0.5.5 sctransform_0.3.5 rappdirs_0.3.3 glue_1.6.2
[156] XVector_0.40.0 RCurl_1.98-1.12 mnormt_2.1.1 igraph_1.5.0 R6_2.5.1
[161] tidyr_1.3.0 labeling_0.4.2 GenomeInfoDb_1.36.1 DelayedArray_0.26.3 tidyselect_1.2.0
[166] vipor_0.4.5 plotrix_3.8-2 car_3.1-2 future_1.33.0 munsell_0.5.0
[171] KernSmooth_2.23-21 data.table_1.14.8 htmlwidgets_1.6.2 rlang_1.1.1 spatstat.sparse_3.0-2
[176] spatstat.explore_3.2-1 fansi_1.0.4 beeswarm_0.4.0